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

feat: 회원가입 페이지 추가 #48

Merged
merged 10 commits into from
Jan 28, 2025
Merged

feat: 회원가입 페이지 추가 #48

merged 10 commits into from
Jan 28, 2025

Conversation

ptq124
Copy link
Collaborator

@ptq124 ptq124 commented Jan 28, 2025

이슈 번호

작업한 목록을 작성해 주세요

  • 이메일 중복체크
  • 인증코드 6자리
  • 비밀번호 체크
  • react-otp-input 추가

스크린샷

pr 포인트나 궁금한 점을 작성해 주세요

  • react-otp-input 스타일 부분에 VE 적용이 안돼, 인라인 스타일로 넣었습니다..
  • api 들어가는 부분 주석처리 했습니다.

연관된 issue: #30

Copy link

github-actions bot commented Jan 28, 2025

📚 TypeDoc 문서가 배포되었습니다:

@ptq124
Copy link
Collaborator Author

ptq124 commented Jan 28, 2025

form 이랑 input 이번에 동환님이 만드신거 사용했습니다. 잘 만드신거 같아요!

Copy link

github-actions bot commented Jan 28, 2025

Copy link
Collaborator

@DongjaJ DongjaJ left a comment

Choose a reason for hiding this comment

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

고생하셨습니다. 크리티컬하게 이상있는 부분은 없는 것 같아여!

Comment on lines 85 to 88
onClick={() => {
setValue('email', '');
trigger('email');
}}
Copy link
Collaborator

Choose a reason for hiding this comment

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

요기는 react-hook-form에서 제공하는 reset 함수가 있어요!
https://react-hook-form.com/docs/useform/reset
나중에 변경해도 되겠네요

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

변경했습니다. reset도 있네요.. 감사합니다!
근데 password 스텝 부분은 reset이 적용이 안되서 일단 제외시켰습니다. 이건 추후에 알아봐야 할거 같아요

<Button
type="button"
onClick={onClickNextButton}
disabled={!disabled}
Copy link
Collaborator

Choose a reason for hiding this comment

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

disabled = !disabled 로직이 어색한 것 같습니당

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

수정후 푸쉬 완료!

Comment on lines 40 to 45
const disabled =
!password || // 비밀번호가 없거나
!confirmPassword || // 비밀번호 확인이 없거나
password !== confirmPassword || // 비밀번호가 일치하지 않거나
!!errors.password || // 비밀번호 오류가 있거나
!!errors.confirmPassword; // 비밀번호 확인 오류가 있으면 비활성화
Copy link
Collaborator

Choose a reason for hiding this comment

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

formState.isValid로 한번에 체크할 수 있을 것 같습니다.
zod의 z.string().min(1,{message}) 로 1글자 이상의 길이를 입력하도록 강제할 수 있어요
추후 리팩토링하면 좋을 것 같습니다

그리고 사용자 입력 받는쪽에선 error 상태여도 1글자 이상 입력하면 버튼이 활성화 되는거로 알고 있었는데 회원가입쪽은 다른가요?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

똑같이 버튼 활성화 되는데, 1글자 이상이 더 좋을거 같네요.. disabled 분기문이 더 간결해졌습니다.

};

const onClickNextButton = async () => {
const isValid = await trigger('code');
Copy link
Collaborator

Choose a reason for hiding this comment

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

trigger의 반환값이 있는지 몰랐네요. 알아갑니다

# Conflicts:
#	pnpm-lock.yaml
@ptq124 ptq124 merged commit 0a6de16 into main Jan 28, 2025
5 checks passed
@ptq124 ptq124 deleted the feat-30 branch January 28, 2025 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: 회원가입 페이지
2 participants