Skip to content
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

Merged
merged 7 commits into from
Aug 28, 2023

Conversation

guesung
Copy link
Member

@guesung guesung commented Aug 28, 2023

💡 왜 PR을 올렸나요?

  • 신규 피처

💁 무엇이 어떻게 바뀌나요?

  1. 회원 정보 수정 - 성격 api를 구현하였습니다.

💬 리뷰어분들께

@github-actions github-actions bot added the Feature 기존 페이지/컴포넌트에서 기능을 추가한 경우 label Aug 28, 2023
@github-actions
Copy link

Labeler가 제목과 설명에 있는 특별한 텍스트와 일치하는 레이블을 적용했습니다.
Label을 검토하고 필요한 변경 사항을 적용해 주세요.

Comment on lines 85 to 86
if (status === 'personalities')
return <PersonalityEditPage onClose={() => setStatus('profile')} />;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

InputForm 컴포넌트 안에 personality 페이지 분기처리 로직이 들어가있네요?

리턴되는 컴포넌트들의 추상화 레벨이 다른 것 같아요!

하나는 PersonalityEditPage라는 페이지 컴포넌트 (높은 추상화),
다른 하나는 폼 컴포넌트 (중간 추상화)

라고 생각이 되는데, 폼 컴포넌트를 따로 페이지로 빼두어서 이 컴포넌트를 페이지 분기 처리하는 컴포넌트로 만들어 두면 더 좋을 것 같습니당

Copy link
Member Author

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로 설정하는 방식으로 하여 추상화를 맞추었습니다 ~!

Copy link
Contributor

@kangju2000 kangju2000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

굿굿

@guesung guesung merged commit 412cac4 into develop Aug 28, 2023
1 check passed
@guesung guesung deleted the feature/270-profile-personalityi branch August 28, 2023 11:41
@guesung guesung linked an issue Aug 28, 2023 that may be closed by this pull request
@guesung guesung changed the title [Feature] 회원 정보 수정 - 성격 api 구현 Feature : 회원 정보 수정 - 성격 api 구현 Jan 10, 2024
guesung added a commit that referenced this pull request Jul 12, 2024
[Feature] 회원 정보 수정 - 성격 api 구현
guesung added a commit that referenced this pull request Jul 17, 2024
[Feature] 회원 정보 수정 - 성격 api 구현
guesung added a commit that referenced this pull request Jul 17, 2024
[Feature] 회원 정보 수정 - 성격 api 구현
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature 기존 페이지/컴포넌트에서 기능을 추가한 경우
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] Profile 수정 - 성격
2 participants