Skip to content

Conversation

@ghdtnals
Copy link
Collaborator

@ghdtnals ghdtnals commented May 1, 2025

#️⃣연관된 이슈

ex) #이슈번호, #이슈번호
Closes #46

📝 PR 유형

해당하는 유형에 'x'로 체크해주세요.

  • 기능 추가 (Feature)
  • 버그 수정 (Bug Fix)
  • 코드 개선 (Refactoring)
  • 스타일 변경 (UI/UX)
  • 문서 작업 (Documentation)
  • 환경 설정 (Configuration)
  • 기타 (Other)

📝작업 내용

이번 PR에서 작업한 내용을 간략히 설명해주세요(이미지 첨부 가능)

  • zustand 기반 사용자 상태 관리
  • SignupPage 컴포넌트 구현
  • 사장님 로그인 후 ShopPage로 이동
  • 알바 로그인 후 ProfilePage로 이동

스크린샷 (선택)

💬리뷰 요구사항(선택)

리뷰어가 특별히 봐주었으면 하는 부분이 있다면 작성해주세요

ex) 메서드 XXX의 이름을 더 잘 짓고 싶은데 혹시 좋은 명칭이 있을까요?

  • Alert 컴포넌트 구현되면 Alert 관련 주석 처리한 부분은 그에 맞게 수정하도록 하겠습니다. (현재는 Alert 창이 뜨지 않고 바로 페이지 이동)

@netlify
Copy link

netlify bot commented May 1, 2025

Deploy Preview for thejulge1 ready!

Name Link
🔨 Latest commit 7155ef8
🔍 Latest deploy log https://app.netlify.com/sites/thejulge1/deploys/6814500c31e1120008655c33
😎 Deploy Preview https://deploy-preview-57--thejulge1.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Collaborator

@almighty55555 almighty55555 left a comment

Choose a reason for hiding this comment

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

수고하셨습니다!

Comment on lines 134 to 139
setFormData({
email: "",
password: "",
confirmPassword: "",
userType: "employee",
});
Copy link
Collaborator

Choose a reason for hiding this comment

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

finally에서 setFormData()를 호출해 초기화를 하고 있는데 이 경우라면 서버 요청이 실패해도 폼이 초기화되어 사용자 입장에서는 에러가 났는데 입력값이 사라져서 재입력을 해야 하는 불편한 UX가 될 것 같습니다.

성공했을 경우에만 초기화를 시켜주는 건 어떨까요?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

넵 성공했을 때만 초기화를 시켜주는 것이 좋을 것 같습니다👍

if (field === "email") {
setErrors((prev) => ({
...prev,
email: e.target.value.includes("@")
Copy link
Collaborator

Choose a reason for hiding this comment

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

includes("@")만으로는 잘못된 형태가 많이 통과될 것 같습니다. (도메인이 없는 경우, @가 두 번 사용된 경우 등) 간단한 정규식을 사용해서 이메일 포맷을 좀 더 안정적으로 검증하는 게 어떨까요?

일례로 아래와 같이 작성할 수 있다고 합니당

const isValidEmail = /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e.target.value);

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

해당 부분도 더 안전하게 검증하는 것이 좋을 것 같다고 생각합니다👍

Copy link
Collaborator

Choose a reason for hiding this comment

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

유효성 검사랑 상태 업데이트 로직이 너무 뭉쳐 있어서 따로 훅으로 추출하는 것도 좋을 것 같습니다. 이것은 그냥 저의 의견 ㅎㅎ입니당

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

리뷰 주신 부분들 반영하여 코드 수정하도록 하겠습니다😊

Copy link
Collaborator

@jeonghwanJay jeonghwanJay left a comment

Choose a reason for hiding this comment

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

수고하셨습니다 !

if (field === "email") {
setErrors((prev) => ({
...prev,
email: e.target.value.includes("@")
Copy link
Collaborator

Choose a reason for hiding this comment

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

@만 확인하는 것은 이메일 형식의 최소 조건을 충족하지만, 실제 이메일 주소를 충족하지 않을 수 있을 것 같습니다.!
예를 들어, "abx@"나 "@naver.com" 같은 경우는 유효하지 않지만 @가 포함되어 있어 에러를 발생시키지 않을 것 같습니다.
정규식을 사용해서 이메일 형식을 검증해도 좋을 것 같습니다 ~!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

넵 해당 부분 수정하도록 하겠습니다!👍

@ghdtnals ghdtnals merged commit c28fa13 into dev May 2, 2025
6 checks passed
@cozy-ito cozy-ito added the Feature (기능 추가) 기능을 추가합니다. label May 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature (기능 추가) 기능을 추가합니다.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

회원가입 페이지 구현 (/signup)

5 participants