diff --git a/src/views/ApplyPage/index.tsx b/src/views/ApplyPage/index.tsx index 44589005..f51d3bab 100644 --- a/src/views/ApplyPage/index.tsx +++ b/src/views/ApplyPage/index.tsx @@ -8,6 +8,7 @@ import useCheckBrowser from '@hooks/useCheckBrowser'; import useDate from '@hooks/useDate'; import useScrollToHash from '@hooks/useScrollToHash'; import { DraftDialog, SubmitDialog } from 'views/dialogs'; +import PreventApplyDialog from 'views/dialogs/PreventApplyDialog'; import NoMore from 'views/ErrorPage/components/NoMore'; import BigLoading from 'views/loadings/BigLoding'; @@ -35,6 +36,7 @@ const ApplyPage = ({ onSetComplete }: ApplyPageProps) => { useCheckBrowser(); // 크롬 브라우저 권장 알럿 const draftDialog = useRef(null); + const preventApplyDialog = useRef(null); const submitDialog = useRef(null); const sectionsRef = useRef([]); @@ -187,6 +189,12 @@ const ApplyPage = ({ onSetComplete }: ApplyPageProps) => { const commonQuestionIds = commonQuestions?.questions.map((question) => question.id); const handleSendData = (type: 'draft' | 'submit') => { + if (NoMoreApply) { + preventApplyDialog.current?.showModal(); + + return; + } + const mostRecentSeason = mostRecentSeasonValue === '해당사항 없음' ? 0 : mostRecentSeasonValue; const leaveAbsence = getValues('leaveAbsence') == undefined ? undefined : getValues('leaveAbsence') === '재학' ? false : true; @@ -269,6 +277,7 @@ const ApplyPage = ({ onSetComplete }: ApplyPageProps) => { return ( + ((_, ref) => { + const handlePreventESCKeyPress = (e: KeyboardEvent) => { + if (e.key === 'Escape') e.preventDefault(); + }; + + return ( + +

지원서 제출 기한이 지났어요.

+
+ +
+
+ ); +}); + +PreventApplyDialog.displayName = 'PreventApplyDialog'; + +export default PreventApplyDialog;