Skip to content

Commit

Permalink
chore: dialog들 Form Provider 바깥으로 빼기
Browse files Browse the repository at this point in the history
  • Loading branch information
eonseok-jeon committed Sep 6, 2024
1 parent 5f10cf1 commit 754c83f
Showing 1 changed file with 51 additions and 49 deletions.
100 changes: 51 additions & 49 deletions src/views/ApplyPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ const ApplyPage = ({ onSetComplete }: ApplyPageProps) => {
};

return (
<FormProvider {...methods}>
<>
<DraftDialog ref={draftDialogRef} />
<PreventApplyDialog ref={preventApplyDialogRef} />
<SubmitDialog
Expand All @@ -301,56 +301,58 @@ const ApplyPage = ({ onSetComplete }: ApplyPageProps) => {
handleCloseSubmitDialog();
}}
/>
<div className={container}>
<ApplyHeader
isReview={IS_REVIEW}
isLoading={draftIsPending || submitIsPending}
onSaveDraft={() => handleSendData('draft')}
onSubmitData={handleSubmit(handleApplySubmit)}
/>
<ApplyInfo isReview={IS_REVIEW} />
<ApplyCategory isReview={IS_REVIEW} minIndex={minIndex} />
<form
id="apply-form"
name="apply-form"
onSubmit={handleSubmit(handleApplySubmit)}
className={formContainerVar[deviceType]}>
<DefaultSection
isMakers={isMakers}
<FormProvider {...methods}>
<div className={container}>
<ApplyHeader
isReview={IS_REVIEW}
refCallback={refCallback}
applicantDraft={applicantDraft}
isLoading={draftIsPending || submitIsPending}
onSaveDraft={() => handleSendData('draft')}
onSubmitData={handleSubmit(handleApplySubmit)}
/>
<CommonSection
isReview={IS_REVIEW}
refCallback={refCallback}
questions={commonQuestions?.questions}
commonQuestionsDraft={commonQuestionsDraft}
/>
<PartSection
isReview={IS_REVIEW}
refCallback={refCallback}
part={applicantDraft?.part}
questions={partQuestions}
partQuestionsDraft={partQuestionsDraft}
questionTypes={questionTypes}
/>
<BottomSection isReview={IS_REVIEW} knownPath={applicantDraft?.knownPath} />
<div className={buttonWrapper}>
<Button
isLoading={draftIsPending || submitIsPending}
onClick={() => handleSendData('draft')}
buttonStyle="line">
임시저장
</Button>
<Button isLoading={draftIsPending || submitIsPending} type="submit">
제출하기
</Button>
</div>
</form>
</div>
<Footer />
</FormProvider>
<ApplyInfo isReview={IS_REVIEW} />
<ApplyCategory isReview={IS_REVIEW} minIndex={minIndex} />
<form
id="apply-form"
name="apply-form"
onSubmit={handleSubmit(handleApplySubmit)}
className={formContainerVar[deviceType]}>
<DefaultSection
isMakers={isMakers}
isReview={IS_REVIEW}
refCallback={refCallback}
applicantDraft={applicantDraft}
/>
<CommonSection
isReview={IS_REVIEW}
refCallback={refCallback}
questions={commonQuestions?.questions}
commonQuestionsDraft={commonQuestionsDraft}
/>
<PartSection
isReview={IS_REVIEW}
refCallback={refCallback}
part={applicantDraft?.part}
questions={partQuestions}
partQuestionsDraft={partQuestionsDraft}
questionTypes={questionTypes}
/>
<BottomSection isReview={IS_REVIEW} knownPath={applicantDraft?.knownPath} />
<div className={buttonWrapper}>
<Button
isLoading={draftIsPending || submitIsPending}
onClick={() => handleSendData('draft')}
buttonStyle="line">
임시저장
</Button>
<Button isLoading={draftIsPending || submitIsPending} type="submit">
제출하기
</Button>
</div>
</form>
</div>
<Footer />
</FormProvider>
</>
);
};

Expand Down

0 comments on commit 754c83f

Please sign in to comment.