-
Notifications
You must be signed in to change notification settings - Fork 37
Sprint 11 [장보배] #328
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
Sprint 11 [장보배] #328
Conversation
…ithub-actions [Fix] delete merged branch github action
Feature/component
|
컨플릭 해결해서 올려드립니다! 죄송합니다 ^^... |
withyj-codeit
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 API_BASE_URL = "https://panda-market-api.vercel.app"; | ||
|
|
||
| export const loginUser = async (email: string, password: string) => { | ||
| const response = await axios.post (`${API_BASE_URL}/auth/signIn`,{ |
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.
axios 사용하면 instance 만들어서 baseUrl config 설정해보시면 좋을 것 같아요. (참고)
| return response.data; | ||
| }; | ||
|
|
||
| export const signupUser = async(email:string, nickname:string, password:string, passwordConfirmation:string) => { |
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.
함수에 파라미터를 2개 보다 많이 받아야 할 경우 object로 받는 걸 고려해보면 좋을 것 같아요.
함수를 사용할 때, 파라미터에 들어갈 값들의 순서를 기억하기 힘들고 코드 작성하다가 순서를 잘못 입력하는 걸 막을 수 있어서 권장드려요.
| return( | ||
| <> | ||
| <div className={styles.container}> | ||
| <Image src="/icons/logo.png" alt="logo" width={369} height={132} style ={{cursor: "pointer"}} onClick={handleLogoClick} /> |
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.
next/Link 에 Link 컴포넌트를 활용해도 좋을 것 같아요.
| <Section2 /> | ||
| <Section3 /> | ||
| <Section4 /> | ||
| <Section5 /> |
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.
랜딩 페이지 영역 컴포넌트로 분리하는 것 가독성에 도움될 것 같아 좋아요~
| className?: string; | ||
| }; | ||
|
|
||
| const InputField: React.FC<InputProps> = ({ |
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.
InputField에서 비밀번호 보기/가리기 기능까지 포함하도록 만들었는데,
InputField는 범용적인 Input ui에 사용하도록 하고,
비밀번호 보기/가리기 기능은 따로 분리해 InputField를 사용하는 다른 컴포넌트에서 비밀번호 보기/가리기 기능을 지원하도록 만들어도 좋을 것 같아요.
| passwordConfirmation, | ||
| }); | ||
| return response.data; | ||
| } No newline at end of file |
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.
vscode에서 end of line 추가 설정해주시면 좋을 것 같아요.
| handleSubmit, | ||
| watch, | ||
| formState: { isSubmitting, errors }, | ||
| } = useForm<Inputs>({ |
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 사용하실 때, zod 같이 사용해보시는 것도 권장드려요.
| required: true, | ||
| pattern: { | ||
| value: emailPattern, | ||
| message: "이메일 형식으로 입력해주세요", |
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.
이메일 입력, 비밀번호 입력에 대한 유효성 검사하는 로직은 로그인과 동일하게 가야하는 경우가 일반적이라 유효성 검증 로직을 재사용할 수 있도록 만들어 보면 좋을 것 같아요.
요구사항
기본
심화
주요 변경사항
스크린샷
멘토에게