-
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
feat: 회원가입 페이지 추가 #48
Conversation
📚 TypeDoc 문서가 배포되었습니다: |
form 이랑 input 이번에 동환님이 만드신거 사용했습니다. 잘 만드신거 같아요! |
🚀 Storybook 리뷰가 준비되었습니다: |
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.
고생하셨습니다. 크리티컬하게 이상있는 부분은 없는 것 같아여!
onClick={() => { | ||
setValue('email', ''); | ||
trigger('email'); | ||
}} |
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.
요기는 react-hook-form에서 제공하는 reset 함수가 있어요!
https://react-hook-form.com/docs/useform/reset
나중에 변경해도 되겠네요
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.
변경했습니다. reset도 있네요.. 감사합니다!
근데 password 스텝 부분은 reset이 적용이 안되서 일단 제외시켰습니다. 이건 추후에 알아봐야 할거 같아요
<Button | ||
type="button" | ||
onClick={onClickNextButton} | ||
disabled={!disabled} |
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.
disabled = !disabled 로직이 어색한 것 같습니당
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.
수정후 푸쉬 완료!
const disabled = | ||
!password || // 비밀번호가 없거나 | ||
!confirmPassword || // 비밀번호 확인이 없거나 | ||
password !== confirmPassword || // 비밀번호가 일치하지 않거나 | ||
!!errors.password || // 비밀번호 오류가 있거나 | ||
!!errors.confirmPassword; // 비밀번호 확인 오류가 있으면 비활성화 |
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.
formState.isValid로 한번에 체크할 수 있을 것 같습니다.
zod의 z.string().min(1,{message}) 로 1글자 이상의 길이를 입력하도록 강제할 수 있어요
추후 리팩토링하면 좋을 것 같습니다
그리고 사용자 입력 받는쪽에선 error 상태여도 1글자 이상 입력하면 버튼이 활성화 되는거로 알고 있었는데 회원가입쪽은 다른가요?
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.
똑같이 버튼 활성화 되는데, 1글자 이상이 더 좋을거 같네요.. disabled 분기문이 더 간결해졌습니다.
}; | ||
|
||
const onClickNextButton = async () => { | ||
const isValid = await trigger('code'); |
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.
trigger의 반환값이 있는지 몰랐네요. 알아갑니다
# Conflicts: # pnpm-lock.yaml
이슈 번호
작업한 목록을 작성해 주세요
스크린샷
pr 포인트나 궁금한 점을 작성해 주세요
연관된 issue: #30