-
Notifications
You must be signed in to change notification settings - Fork 0
[Feat] FormInput 수정 & 로그인, 회원가입 폼 컴포넌트 제작 #85
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
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests (beta)
Comment |
🎨 Storybook Report✨ Story가 변경되었습니다 Chromatic에서 비주얼 변경사항을 확인하세요.
|
📊 Coverage Report
📉 #85을 main에 병합하면 coverage가 Coverage 요약@@ Coverage Diff @@
## main #85 +/- ##
===========================================
- Coverage 38.76% 33.44% -5.32%
===========================================
Files 75 80 +5
Lines 2079 2410 +331
Branches 157 162 +5
===========================================
Hits 806 806 0
+ Misses 1273 1604 +331 영향받은 파일✅ 이 PR로 영향받은 파일이 없습니다 수정된 모든 파일이 현재 coverage를 유지했습니다. |
🚀 PR Preview Report✨ Build가 성공적으로 완료되었습니다. Preview에서 변경사항을 확인하세요.
|
Chiman2937
left a comment
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 { | ||
| meta: { errors, isTouched }, | ||
| } = field.state; | ||
| const hintMessage = getHintMessage(errors, isTouched, form.state.submissionAttempts); |
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.
getHintMessage가 에러메시지를 처리하는 유틸함수니까, 더 간단하게 이렇게 처리할 수 있을 것 같아요
| const { | |
| meta: { errors, isTouched }, | |
| } = field.state; | |
| const hintMessage = getHintMessage(errors, isTouched, form.state.submissionAttempts); | |
| const hintMessage = getHintMessage(field); |
그러면 아래처럼 isTouched랑 errors를 전부 field에서 뽑을 수 있어서 JSX 리턴문을 좀 더 간소화 시킬 수 있게 돼요!
const getHintMessage = (field: AnyFieldAPI) => {
const errors = field.state.meta.errors
...
};| className='flex-col-center w-full gap-8' | ||
| onSubmit={(e) => { | ||
| e.preventDefault(); | ||
| void form.handleSubmit(); |
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.
오 void라는게 있는지 몰랐네요 좋은 것 같습니다
|
|
||
| return ( | ||
| <Button | ||
| className='border-none' |
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.
기본 primary 버튼에 border 없었던 것 같은데 맞다면 border-none은 지우면 좋을 것 같습니다!
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.
이상하게 제 화면에서 border이 생겨있더라구요,,,, 원인을 찾는 중이니까 찾아내면 바로 수정하겠습니다!
📝 변경 사항
💡 components/shared/form-input/index.tsx
사용 방법
💡 components/shared/search-bar/index.tsx
value/onChange props 유무에 따라 제어/비제어 패턴 모두 지원하도록 로직 수정
사용 방법 - 비제어
사용 방법 - 제어
💡 components/pages/login/login-form/index.tsx
💡 components/pages/signup/signup-form/index.tsx
💡 lib/schema/auth.ts
🔗 관련 이슈
Closes #43
🧪 테스트 방법
📸 스크린샷 (선택)
📋 체크리스트
💬 추가 코멘트
CodeRabbit Review는 자동으로 실행되지 않습니다.
Review를 실행하려면 comment에 아래와 같이 작성해주세요