diff --git a/src/components/AttendanceStatus.tsx b/src/components/AttendanceStatus.tsx index 49a0f817..af353240 100644 --- a/src/components/AttendanceStatus.tsx +++ b/src/components/AttendanceStatus.tsx @@ -1,12 +1,14 @@ import { Box, Button, Grid, Typography } from '@mui/material'; -import { CreateOutlined } from '@mui/icons-material'; -import { useTranslation } from 'next-i18next'; import { CircularProgressbar, buildStyles } from 'react-circular-progressbar'; -import { shortDateFormat } from '@/utils/Helper'; -import { useTheme } from '@mui/material/styles'; +import { formatToShowDateMonth, shortDateFormat } from '@/utils/Helper'; + +import { CreateOutlined } from '@mui/icons-material'; import useDeterminePathColor from '../hooks/useDeterminePathColor'; +import { useTheme } from '@mui/material/styles'; +import { useTranslation } from 'next-i18next'; interface AttendanceStatusProps { + date: Date; formattedAttendanceData: FormattedAttendanceData; onDateSelection: Date; onUpdate?: () => void; @@ -23,6 +25,7 @@ type FormattedAttendanceData = { }; function AttendanceStatus({ + date, formattedAttendanceData, onDateSelection, onUpdate, @@ -56,7 +59,18 @@ function AttendanceStatus({ justifyContent="space-between" alignItems={'center'} > - + + + + {formatToShowDateMonth(date)} + + {attendanceStatus !== 'notMarked' && attendanceStatus !== 'futureDate' && ( diff --git a/src/components/AttendanceStatusListView.tsx b/src/components/AttendanceStatusListView.tsx index 9e319a0f..2bd5c2b0 100644 --- a/src/components/AttendanceStatusListView.tsx +++ b/src/components/AttendanceStatusListView.tsx @@ -2,6 +2,7 @@ import { Box, Typography } from '@mui/material'; import { ATTENDANCE_ENUM } from '../utils/Helper'; import { AttendanceStatusListViewProps } from '../utils/Interfaces'; +import { BorderBottom } from '@mui/icons-material'; import CancelIcon from '@mui/icons-material/Cancel'; //absent import CheckCircleIcon from '@mui/icons-material/CheckCircle'; //present import CheckCircleOutlineIcon from '@mui/icons-material/CheckCircleOutline'; @@ -22,14 +23,17 @@ const AttendanceStatusListView: React.FC = ({ const boxStyling = { display: 'flex', - height: '56px', + height: isBulkAction ? '56px' : '', // width: '100%', // borderBottom: `0.5px solid ${theme.palette.warning[400]}`, padding: '8px', alignItems: 'center', borderRadius: isBulkAction ? '8px' : 0, - marginBottom: '12px', + // marginBottom: '12px', backgroundColor: isBulkAction ? theme.palette.warning[800] : 'none', + // position: isBulkAction ? 'fixed' : 'none', + // width: isBulkAction ? '89%' : '100%', + borderBottom: isBulkAction ? 'none' : '1px solid #D0C5B4', }; const handleClickAction = ( @@ -42,73 +46,78 @@ const AttendanceStatusListView: React.FC = ({ } }; return ( - - - {isBulkAction ? t('ATTENDANCE.MARK_ALL') : userData?.name} - - - handleClickAction( - isBulkAction, - ATTENDANCE_ENUM.PRESENT, - isBulkAction ? '' : userData?.userId - ) - } - > - {[userData?.attendance, bulkAttendanceStatus].includes( - ATTENDANCE_ENUM.PRESENT - ) ? ( - theme.palette.warning[400] }} /> - ) : ( - theme.palette.warning[400] }} - /> - )} + + theme.palette.warning[400] }} + variant="body1" + marginRight="auto" + marginY="auto" + sx={{ + color: theme.palette.warning['300'], + textAlign: 'left', + }} > - {t('ATTENDANCE.PRESENT')} + {isBulkAction ? t('ATTENDANCE.MARK_ALL') : userData?.name} - - - handleClickAction( - isBulkAction, - ATTENDANCE_ENUM.ABSENT, - isBulkAction ? '' : userData?.userId - ) - } - > - {[userData?.attendance, bulkAttendanceStatus].includes( - ATTENDANCE_ENUM.ABSENT - ) ? ( - theme.palette.warning[400] }} /> - ) : ( - - )} - theme.palette.warning[400] }} + + handleClickAction( + isBulkAction, + ATTENDANCE_ENUM.PRESENT, + isBulkAction ? '' : userData?.userId + ) + } > - {t('ATTENDANCE.ABSENT')} - + {[userData?.attendance, bulkAttendanceStatus].includes( + ATTENDANCE_ENUM.PRESENT + ) ? ( + theme.palette.warning[400] }} /> + ) : ( + theme.palette.warning[400] }} + /> + )} + theme.palette.warning[400] }} + > + {t('ATTENDANCE.PRESENT')} + + + + handleClickAction( + isBulkAction, + ATTENDANCE_ENUM.ABSENT, + isBulkAction ? '' : userData?.userId + ) + } + > + {[userData?.attendance, bulkAttendanceStatus].includes( + ATTENDANCE_ENUM.ABSENT + ) ? ( + theme.palette.warning[400] }} /> + ) : ( + + )} + theme.palette.warning[400] }} + > + {t('ATTENDANCE.ABSENT')} + + ); diff --git a/src/components/MarkBulkAttendance.tsx b/src/components/MarkBulkAttendance.tsx index 5b5bc89a..0fa50b01 100644 --- a/src/components/MarkBulkAttendance.tsx +++ b/src/components/MarkBulkAttendance.tsx @@ -1,19 +1,20 @@ import { Box, Button, Fade, Modal, Typography } from '@mui/material'; import React, { useEffect } from 'react'; -import Loader from './Loader'; -import AttendanceStatusListView from './AttendanceStatusListView'; -import { useTranslation } from 'next-i18next'; -import { shortDateFormat } from '../utils/Helper'; -import CloseIcon from '@mui/icons-material/Close'; -import { useTheme } from '@mui/material/styles'; -import Backdrop from '@mui/material/Backdrop'; -import { getMyCohortMemberList } from '@/services/MyClassDetailsService'; +import Snackbar, { SnackbarOrigin } from '@mui/material/Snackbar'; import { attendanceStatusList, bulkAttendance, } from '@/services/AttendanceService'; -import Snackbar, { SnackbarOrigin } from '@mui/material/Snackbar'; + import { AttendanceStatusListProps } from '../utils/Interfaces'; +import AttendanceStatusListView from './AttendanceStatusListView'; +import Backdrop from '@mui/material/Backdrop'; +import CloseIcon from '@mui/icons-material/Close'; +import Loader from './Loader'; +import { getMyCohortMemberList } from '@/services/MyClassDetailsService'; +import { shortDateFormat } from '../utils/Helper'; +import { useTheme } from '@mui/material/styles'; +import { useTranslation } from 'next-i18next'; interface State extends SnackbarOrigin { openModal: boolean; @@ -277,6 +278,7 @@ const MarkBulkAttendace: React.FC = ({ timeout: 500, }, }} + className="modal_mark" > = ({ height={'80%'} > - + = ({ marginTop: '10px', fontSize: '12px', color: theme.palette.warning['A200'], + padding: '0 10px', }} > {t('ATTENDANCE.TOTAL_STUDENTS', { @@ -340,10 +347,14 @@ const MarkBulkAttendace: React.FC = ({ {cohortMemberList && cohortMemberList?.length != 0 ? ( - + = ({