Skip to content

Commit

Permalink
Merge pull request #58 from vaivk369/oblf
Browse files Browse the repository at this point in the history
issue #000 fix: marking individual attendance
  • Loading branch information
vaivk369 authored Feb 28, 2024
2 parents 0d6598e + cd34a99 commit 3f1615b
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions packages/cohort/src/pages/CohortMemberList.js
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,16 @@ export default function CohortMemberList({ footerLinks, appName }) {
let attendanceRecord = attendanceStatusData?.find(
(record) => record?.userId === item?.userId
);
let changedRecord = selectedAttendance?.records?.find(
(record) => record?.userId === item?.userId
);
let memberAttendance = ''
if (changedRecord && changedRecord.userId) {
memberAttendance = changedRecord.attendance;
} else {
memberAttendance = attendanceRecord.attendance;
}

return (
<Box
p="2"
Expand All @@ -370,16 +380,14 @@ export default function CohortMemberList({ footerLinks, appName }) {
{attendanceRecord.attendance}
</Button>
) : null}

<HStack w={130} justifyContent="space-between">
<Flex>
<TouchableOpacity>
<IconByName
name="CheckboxCircleLineIcon"
color={
(attendanceRecord &&
attendanceRecord.attendance === "Present") ||
(!attendanceRecord &&
selectedAttendance.type === "Present")
(memberAttendance === "Present")
? "profile.present"
: "gray"
}
Expand All @@ -404,10 +412,7 @@ export default function CohortMemberList({ footerLinks, appName }) {
<IconByName
name="CheckboxCircleLineIcon"
color={
(attendanceRecord &&
attendanceRecord.attendance === "Absent") ||
(!attendanceRecord &&
selectedAttendance.type === "Absent")
(memberAttendance === "Absent")
? "profile.absent"
: "gray"
}
Expand Down

0 comments on commit 3f1615b

Please sign in to comment.