diff --git a/frontend/src/components/MeetingConfirmCalendar/Viewer/index.tsx b/frontend/src/components/MeetingConfirmCalendar/Viewer/index.tsx index 34c8b18f2..44a5d01a7 100644 --- a/frontend/src/components/MeetingConfirmCalendar/Viewer/index.tsx +++ b/frontend/src/components/MeetingConfirmCalendar/Viewer/index.tsx @@ -15,10 +15,14 @@ import { import { Button } from '@components/_common/Buttons/Button'; import TabButton from '@components/_common/Buttons/TabButton'; import Calendar from '@components/_common/Calendar'; +import MeetingLockConfirmModal from '@components/_common/Modal/MeetingLockConfirmModal'; import ScreenReaderOnly from '@components/_common/ScreenReaderOnly'; +import Text from '@components/_common/Text'; +import useConfirmModal from '@hooks/useConfirmModal/useConfirmModal'; import useRouter from '@hooks/useRouter/useRouter'; +import { useLockMeetingMutation } from '@stores/servers/meeting/mutations'; import { useGetSchedules } from '@stores/servers/schedule/queries'; import { formatAriaTab } from '@utils/a11y'; @@ -52,6 +56,11 @@ export default function Viewer({ const { handleToggleIsTimePickerUpdate } = useContext(TimePickerUpdateStateContext); const { isLoggedIn, userName } = useContext(AuthContext).state; + const { isConfirmModalOpen, onToggleConfirmModal } = useConfirmModal(); + const { mutate: lockMutate } = useLockMeetingMutation(); + + const routerToMeetingConfirmPage = () => routeTo(`/meeting/${uuid}/confirm`); + const handleScheduleUpdate = () => { if (!isLoggedIn) { alert('로그인 해주세요'); @@ -78,6 +87,20 @@ export default function Viewer({ } }; + const handleConfirmPageRoute = () => { + if (!isLocked) { + onToggleConfirmModal(); + return; + } + + routerToMeetingConfirmPage(); + }; + + const handleMeetingLockWithRoute = () => { + lockMutate(uuid); + routerToMeetingConfirmPage(); + }; + return ( meetingSchedules && ( <> @@ -139,11 +162,7 @@ export default function Viewer({ + + + + 약속을 확정하기 위해서는 우선 + + + + 약속을 잠그고 약속 확정 페이지로 이동할까요? + + ) ); diff --git a/frontend/src/stores/servers/user/mutations.ts b/frontend/src/stores/servers/user/mutations.ts index 242e02b17..505562285 100644 --- a/frontend/src/stores/servers/user/mutations.ts +++ b/frontend/src/stores/servers/user/mutations.ts @@ -22,7 +22,7 @@ export const usePostLoginMutation = () => { setIsLoggedIn(true); setUserName(userName); - routeTo(`/meeting/${uuid}`); + routeTo(`/meeting/${uuid}/register`); }, }); };