diff --git a/src/components/AttendanceStatusListView.tsx b/src/components/AttendanceStatusListView.tsx index 2bd5c2b0..0c144ebd 100644 --- a/src/components/AttendanceStatusListView.tsx +++ b/src/components/AttendanceStatusListView.tsx @@ -26,7 +26,7 @@ const AttendanceStatusListView: React.FC = ({ height: isBulkAction ? '56px' : '', // width: '100%', // borderBottom: `0.5px solid ${theme.palette.warning[400]}`, - padding: '8px', + padding: isBulkAction ? '0 8px' : '0 8px', alignItems: 'center', borderRadius: isBulkAction ? '8px' : 0, // marginBottom: '12px', @@ -64,7 +64,7 @@ const AttendanceStatusListView: React.FC = ({ flexDirection="column" alignItems="center" className="icon_holder" - p={2} + p={1} onClick={() => handleClickAction( isBulkAction, @@ -94,7 +94,8 @@ const AttendanceStatusListView: React.FC = ({ display="flex" flexDirection="column" alignItems="center" - p={2} + className="icon_holder" + p={1} onClick={() => handleClickAction( isBulkAction, diff --git a/src/components/MarkBulkAttendance.tsx b/src/components/MarkBulkAttendance.tsx index 0fa50b01..9403c298 100644 --- a/src/components/MarkBulkAttendance.tsx +++ b/src/components/MarkBulkAttendance.tsx @@ -347,7 +347,7 @@ const MarkBulkAttendace: React.FC = ({ {cohortMemberList && cohortMemberList?.length != 0 ? ( void; + handleSorting: ( + sortByName: string, + sortByAttendance: string, + sortByClassesMissed: string, + sortByAttendanceNumber: string + ) => void; handleCloseModal: () => void; isModalOpen: boolean; - routeName: string + routeName: string; } const SortingModal: React.FC = ({ handleSorting, isModalOpen, handleCloseModal, - routeName + routeName, }) => { const [sortByName, setSortByName] = React.useState('asc'); const [sortByAttendance, setSortByAttendance] = React.useState(''); const [sortByClassesMissed, setSortByClassesMissed] = React.useState(''); - const [sortByAttendanceNumber, setSortByAttendanceNumber] = React.useState(''); + const [sortByAttendanceNumber, setSortByAttendanceNumber] = + React.useState(''); const { t } = useTranslation(); const theme = useTheme(); // handle changes names from sorting const handleSortByName = (event: React.ChangeEvent) => { setSortByAttendance(''); - setSortByClassesMissed('') - setSortByAttendanceNumber('') + setSortByClassesMissed(''); + setSortByAttendanceNumber(''); // if (event.target.value === 'asc' || event.target.value === 'desc') { - setSortByName(event.target.value); + setSortByName(event.target.value); // } // else { // setSortByAttendance(event.target.value); @@ -52,8 +58,8 @@ const SortingModal: React.FC = ({ ) => { setSortByAttendance(event.target.value); setSortByName(''); - setSortByClassesMissed('') - setSortByAttendanceNumber('') + setSortByClassesMissed(''); + setSortByAttendanceNumber(''); }; const handleSortByAttendanceNumber = ( @@ -62,21 +68,25 @@ const SortingModal: React.FC = ({ setSortByAttendanceNumber(event.target.value); setSortByAttendance(''); setSortByName(''); - setSortByClassesMissed('') + setSortByClassesMissed(''); }; - + const handleSortByClassesMissed = ( event: React.ChangeEvent ) => { setSortByClassesMissed(event.target.value); setSortByAttendance(''); setSortByName(''); - setSortByAttendanceNumber('') + setSortByAttendanceNumber(''); }; - const handleApplySort = () => { - handleSorting(sortByName, sortByAttendance, sortByClassesMissed, sortByAttendanceNumber); + handleSorting( + sortByName, + sortByAttendance, + sortByClassesMissed, + sortByAttendanceNumber + ); handleCloseModal(); }; @@ -96,102 +106,102 @@ const SortingModal: React.FC = ({ }} /> - - {routeName== "/attendance-overview" ? - <> - - - - {t('COMMON.ATTENDANCE')} - - - } - label={t('COMMON.HIGH_TO_LOW')} - /> - } - label={t('COMMON.LOW_TO_HIGH')} - /> - - - - - - - - {t('COMMON.CLASS_MISSED')} - - - } - label={t('COMMON.HIGH_TO_LOW')} - /> - } - label={t('COMMON.LOW_TO_HIGH')} - /> - - - : - - - - - - {t('COMMON.ATTENDANCE')} - - - } - label={t('ATTENDANCE.PRESENT')} - /> - } - label={t('ATTENDANCE.ABSENT')} - /> - - - - } + {routeName == '/attendance-overview' ? ( + <> + + + + {t('COMMON.ATTENDANCE')} + + + } + label={t('COMMON.HIGH_TO_LOW')} + /> + } + label={t('COMMON.LOW_TO_HIGH')} + /> + + + + + + + {t('COMMON.CLASS_MISSED')} + + + } + label={t('COMMON.HIGH_TO_LOW')} + /> + } + label={t('COMMON.LOW_TO_HIGH')} + /> + + + {' '} + + ) : ( + + + + {t('COMMON.ATTENDANCE')} + + + } + label={t('ATTENDANCE.PRESENT')} + /> + } + label={t('ATTENDANCE.ABSENT')} + /> + + + + )} - + = ({ > } + control={} label={t('COMMON.A_TO_Z')} /> } + control={} label={t('COMMON.Z_TO_A')} /> diff --git a/src/pages/dashboard.tsx b/src/pages/dashboard.tsx index 80bd0a9e..a113cf64 100644 --- a/src/pages/dashboard.tsx +++ b/src/pages/dashboard.tsx @@ -189,7 +189,7 @@ const Dashboard: React.FC = () => { filters: { fromDate: selectedDate || currentDate, toDate: selectedDate || currentDate, - contextId: classId + contextId: classId, }, }; const res = await attendanceStatusList(attendanceStatusData); @@ -725,7 +725,7 @@ const Dashboard: React.FC = () => { {cohortMemberList && cohortMemberList?.length != 0 ? (