-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature : 회원 정보 수정 - 성격 api 구현 #271
Conversation
Labeler가 제목과 설명에 있는 특별한 텍스트와 일치하는 레이블을 적용했습니다. |
if (status === 'personalities') | ||
return <PersonalityEditPage onClose={() => setStatus('profile')} />; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
InputForm
컴포넌트 안에 personality 페이지 분기처리 로직이 들어가있네요?
리턴되는 컴포넌트들의 추상화 레벨이 다른 것 같아요!
하나는 PersonalityEditPage
라는 페이지 컴포넌트 (높은 추상화),
다른 하나는 폼 컴포넌트 (중간 추상화)
라고 생각이 되는데, 폼 컴포넌트를 따로 페이지로 빼두어서 이 컴포넌트를 페이지 분기 처리하는 컴포넌트로 만들어 두면 더 좋을 것 같습니당
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// ProfileEdit.client.tsx
const [step, setStep] = useState(1);
const { data: defaultProfileData } = useGetProfile();
<EditProvider defaultValues={defaultProfileData}>
{step === 1 && <Step1 onNext={() => setStep(2)} />}
{step === 2 && <Step2 onPrev={() => setStep(1)} />}
</EditProvider>
위와 같이 ProfileEdit
컴포넌트에서 Step1,2로 상태값을 관리하여 렌더링하는 방식으로 바꾸었습니다. 데이터를 한 번만 fetch해오고, defaultValue로 설정하는 방식으로 하여 추상화를 맞추었습니다 ~!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
굿굿
[Feature] 회원 정보 수정 - 성격 api 구현
[Feature] 회원 정보 수정 - 성격 api 구현
[Feature] 회원 정보 수정 - 성격 api 구현
💡 왜 PR을 올렸나요?
💁 무엇이 어떻게 바뀌나요?
💬 리뷰어분들께