Skip to content

Conversation

@se-eun-park
Copy link

@se-eun-park se-eun-park commented Feb 27, 2024

프로젝트 링크

🛠️ Motivation

사용 이유

react-hook-form

  • 제어 컴포넌트를 사용할 때 보다 훨씬 적은 코드로 개발 가능하다.
  • 다양한 API를 제공해준다.

react-router-dom

  • 전체 페이지 로딩 방식이 아니기 때문에 부드러운 화면전환이 가능하다.
  • 컴포넌트마다 URL을 만들어줘 북마크 또는 히스토리 기능 사용을 가능하게 한다.

tailwind

  • 클래스의 이름을 고민하지 않아도 된다.
  • 컴포넌트 추출을 통해 코드 DRY를 유지하는 데 도움이 된다.

🔑 Key Changes

  • Home 페이지에서 회원가입 버튼 누르면 SignUp 페이지로 이동
  • 이메일, 비밀번호, 비밀번호 확인 유효성 검사
  • 회원가입 완료 시, SignUp 페이지에 입력받은 데이터 알림창 등장
  • 알림창 확인 버튼 누른 후, Home 페이지로 다시 이동

🙏🏼 To Reviewers

추후에 해당 기능들을 추가할 예정입니다.
아래 기능들 추가 구현 할 때, 방해될 만한 요소들?이 없는지 고려해서 봐주시면 감사하겠습니다!

  • 유효성 검사에 통과하지 못하면 버튼이 비활성화되는 기능
  • 눈 모양 아이콘을 누르면 비밀번호가 text 형식으로 바뀜

Copy link
Member

@kwakseongjae kwakseongjae left a comment

Choose a reason for hiding this comment

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

리뷰를 원했던 두 기능을 구현하는데 충돌한만한 부분이 있나 체크해봤는데
규모가 작아서 그런지 문제될 부분은 없어보였어 !!
고민한 흔적이 보이는 작업물이라서 좋았습니당 !!!
에러와 관련된 부분을 분기처리하는 로직이 따로 있으면 좋겠다는 생각은 드네요 ! (시간 남으면 리팩토링 !?)

Copy link
Member

Choose a reason for hiding this comment

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

Tailwind는 기본적으로 reset css가 적용된답니다.
안써도 돼요 !!
아래 아티클 한번 구경해보세요 ~~!~!
https://www.daleseo.com/tailwind-preflight/

Comment on lines +7 to +12
<BrowserRouter>
<Routes>
<Route path="/" element={<HomePage />} />
<Route path="/signup" element={<SignUpPage />} />
</Routes>
</BrowserRouter>
Copy link
Member

Choose a reason for hiding this comment

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

👍👍

Copy link
Member

Choose a reason for hiding this comment

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

SignUpButton이라고 따로 컴포넌트를 나눌 필요가 있나 싶어 !
커스텀 잘 했잖아 Tailwind ! 그걸로 한번 써봐
Tailwind 쓸때 이런식으로 컴포넌트화시켜서 쓰진 않는거같아

Comment on lines +17 to +19
const emailRegex =
/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/;
const passwordRegex = /^(?=.*\d)(?=.*[a-z])(?=.*[!@#])[\da-zA-Z!@#]{8,16}$/;
Copy link
Member

Choose a reason for hiding this comment

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

이런 상수는 난 최상단(함수 컴포넌트 외부)으로 올리거나
아예 파일로 빼서 관리하는 편이야 !

};

return (
<form onSubmit={handleSubmit(onSubmit)}>
Copy link
Member

Choose a reason for hiding this comment

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

이렇게 짜는게 좋은 코드인지 잘 모르겠네 ..!
다른 리드분 의견은 다를지 모르겠는데
나였으면 onSubmit함수안에서 handleSubmit을 호출하지 않을까 싶어 ! 그러면 onSubmit만 전달하면 되겠지 ?
onSubmit으로 handleSubmit에 onSubmit을 콜백으로 전달하는 구조가 가독성이 좋아보이진 않넹

Copy link
Member

Choose a reason for hiding this comment

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

요고 컨벤션인가,, 상우도 이렇게 쓴거보면 내가 잘못된걸지도 !?

Comment on lines +31 to +33
<label className="labelText" htmlFor="email">
이메일
</label>
Copy link
Member

Choose a reason for hiding this comment

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

👍👍

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.

2 participants