Skip to content

Conversation

@katej0320
Copy link
Collaborator

요구사항

기본

  • [x]
  • []
  • []

심화

  • [x]
  • []

주요 변경사항

스크린샷

image

멘토에게

  • 셀프 코드 리뷰를 통해 질문 이어가겠습니다.

@katej0320
Copy link
Collaborator Author

컨플릭 해결해서 올려드립니다! 죄송합니다 ^^...

Copy link
Contributor

@withyj-codeit withyj-codeit left a 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`,{
Copy link
Contributor

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) => {
Copy link
Contributor

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} />
Copy link
Contributor

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 />
Copy link
Contributor

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> = ({
Copy link
Contributor

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
Copy link
Contributor

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>({
Copy link
Contributor

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: "이메일 형식으로 입력해주세요",
Copy link
Contributor

Choose a reason for hiding this comment

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

이메일 입력, 비밀번호 입력에 대한 유효성 검사하는 로직은 로그인과 동일하게 가야하는 경우가 일반적이라 유효성 검증 로직을 재사용할 수 있도록 만들어 보면 좋을 것 같아요.

@withyj-codeit withyj-codeit merged commit d11e458 into codeit-bootcamp-frontend:Next-장보배 Mar 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants