diff --git a/src/components/MarkAttendance.tsx b/src/components/MarkAttendance.tsx index dfcaa8a6..dfc6a68a 100644 --- a/src/components/MarkAttendance.tsx +++ b/src/components/MarkAttendance.tsx @@ -50,6 +50,7 @@ const MarkAttendance: React.FC = ({ const { t } = useTranslation(); const [updatedStatus, setUpdatedStatus] = React.useState(currentStatus); + useEffect(() => { if (isOpen) { setUpdatedStatus(currentStatus); @@ -73,7 +74,6 @@ const MarkAttendance: React.FC = ({ const { vertical, horizontal, openModal } = modal; const submitUpdateAttendance = async () => { - console.log(updatedStatus); try { const learnerId = localStorage.getItem('learnerId'); const classId = localStorage.getItem('classId'); @@ -100,42 +100,10 @@ const MarkAttendance: React.FC = ({ setModal({ ...newState, openModal: true }); }; - // const submitClearAttendance = () => { - // setStatus(ATTENDANCE_ENUM.NOT_MARKED); - // handleClose(); - // handleMarkClearAttendanceModal(); - // }; - - // const submitAttendance = (newState: SnackbarOrigin) => () => { - // handleSubmit(date, status); - // // setOpenMarkUpdateAttendance(!openMarkUpdateAttendance); - // setModal({ ...newState, openModal: true }); - // setTimeout(() => { - // handleSnackbarClose(); - // }, SNACKBAR_AUTO_HIDE_DURATION); - // }; - - // const submitConfirmAttendance = (newState: SnackbarOrigin) => () => { - // // setOpenMarkClearAttendance(!openMarkClearAttendance); - // handleMarkUpdateAttendanceModal(); - // handleSubmit(date, status); - - // setModal({ ...newState, openModal: true }); - // setTimeout(() => { - // handleSnackbarClose(); - // }, SNACKBAR_AUTO_HIDE_DURATION); - // }; - const handleSnackbarClose = () => { setModal({ ...modal, openModal: false }); }; - // const handleClear = () => { - // if (status !== ATTENDANCE_ENUM.NOT_MARKED) { - // setStatus(ATTENDANCE_ENUM.NOT_MARKED); - // } - // }; - const getButtonComponent = ( value: string, icon1: IconType, @@ -143,7 +111,6 @@ const MarkAttendance: React.FC = ({ text: string ) => { // setStatus(currentStatus); - return ( = ({