Skip to content

Commit

Permalink
feat(CreateMeetingPage): 퍼널에서 입력된 정보를 모달과 연결하여 약속 생성 정보 확인 기능 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
Yoonkyoungme committed Oct 17, 2024
1 parent 933428f commit b58b98e
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export default function MeetingCreationConfirmModal({
<h3>
{year}{month}
</h3>
<span>{dates.join(', ')}</span>
<div>{dates.join(', ')}</div>
</div>
);
})}
Expand Down
71 changes: 45 additions & 26 deletions frontend/src/pages/CreateMeetingPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,21 @@ import MeetingDateTime from '@pages/CreateMeetingPage/components/MeetingDateTime
import MeetingHostInfo from '@pages/CreateMeetingPage/components/MeetingHostInfo';
import MeetingName from '@pages/CreateMeetingPage/components/MeetingName';

import useConfirmModal from '@hooks/useConfirmModal/useConfirmModal';
import useCreateMeeting from '@hooks/useCreateMeeting/useCreateMeeting';
import useFunnel from '@hooks/useFunnel/useFunnel';

import { CREATE_MEETING_STEPS, meetingStepValues } from '@constants/meeting';

import MeetingCreationConfirmModal from './components/MeetingCreationConfirmModal';

type Steps = typeof meetingStepValues;

export default function CreateMeetingPage() {
const { isConfirmModalOpen, onToggleConfirmModal } = useConfirmModal();

const [setStep, Funnel] = useFunnel<Steps>(meetingStepValues, '약속이름');

const {
meetingNameInput,
isMeetingNameInvalid,
Expand All @@ -25,31 +31,44 @@ export default function CreateMeetingPage() {
} = useCreateMeeting();

return (
<Funnel>
<Funnel.Step name={CREATE_MEETING_STEPS.meetingName}>
<MeetingName
meetingNameInput={meetingNameInput}
isMeetingNameInvalid={isMeetingNameInvalid}
onNextStep={() => setStep(CREATE_MEETING_STEPS.meetingHostInfo)}
/>
</Funnel.Step>
<Funnel.Step name={CREATE_MEETING_STEPS.meetingHostInfo}>
<MeetingHostInfo
hostNickNameInput={hostNickNameInput}
hostPasswordInput={hostPasswordInput}
isHostInfoInvalid={isHostInfoInvalid}
onNextStep={() => setStep(CREATE_MEETING_STEPS.meetingDateTime)}
/>
</Funnel.Step>
<Funnel.Step name={CREATE_MEETING_STEPS.meetingDateTime}>
<MeetingDateTime
meetingDateInput={meetingDateInput}
meetingTimeInput={meetingTimeInput}
meetingTypeInput={meetingTypeInput}
isCreateMeetingFormInvalid={isCreateMeetingFormInvalid}
onMeetingCreateButtonClick={handleMeetingCreateButtonClick}
/>
</Funnel.Step>
</Funnel>
<>
<Funnel>
<Funnel.Step name={CREATE_MEETING_STEPS.meetingName}>
<MeetingName
meetingNameInput={meetingNameInput}
isMeetingNameInvalid={isMeetingNameInvalid}
onNextStep={() => setStep(CREATE_MEETING_STEPS.meetingHostInfo)}
/>
</Funnel.Step>
<Funnel.Step name={CREATE_MEETING_STEPS.meetingHostInfo}>
<MeetingHostInfo
hostNickNameInput={hostNickNameInput}
hostPasswordInput={hostPasswordInput}
isHostInfoInvalid={isHostInfoInvalid}
onNextStep={() => setStep(CREATE_MEETING_STEPS.meetingDateTime)}
/>
</Funnel.Step>
<Funnel.Step name={CREATE_MEETING_STEPS.meetingDateTime}>
<MeetingDateTime
meetingDateInput={meetingDateInput}
meetingTimeInput={meetingTimeInput}
meetingTypeInput={meetingTypeInput}
isCreateMeetingFormInvalid={isCreateMeetingFormInvalid}
onMeetingCreateButtonClick={onToggleConfirmModal}
/>
</Funnel.Step>
</Funnel>
<MeetingCreationConfirmModal
isModalOpen={isConfirmModalOpen}
onModalClose={onToggleConfirmModal}
onModalConfirmButtonClick={handleMeetingCreateButtonClick}
meetingName={meetingNameInput.value}
hostName={hostNickNameInput.value}
selectedDates={Array.from(meetingDateInput.selectedDates)}
startTime={meetingTimeInput.startTime.value}
endTime={meetingTimeInput.endTime.value}
isOnlyDaysOptionChecked={meetingTypeInput.isChecked}
/>
</>
);
}

0 comments on commit b58b98e

Please sign in to comment.