Skip to content

Conversation

@qowldud
Copy link

@qowldud qowldud commented Apr 10, 2025

✏️ 작업 내용

  • 돌려돌려LP판 회원가입, 로그인

#️⃣ 연관된 이슈

#20


📷 작업 결과

image image 영상은 노션에 올리겠습니다!!

💡 함께 공유하고 싶은 부분

  • react-hook-form의 값들을 contextAPI를 활용해서 사용하였는데 계속 바로바로 값이 적용이 안되어서 힘들었습니다..그래서 찾아보니 useFormContext를 사용하면 되는 것 같습니다! 저도 더 찾아보긴 해야할 것 같아요
  • 아이콘은 react-icons 라이브러리 활용하면 편해요! https://react-icons.github.io/react-icons/

🤔 질문

  • 이번꺼 main에 아직 머지가 안되어서 원래꺼 복사해서 넣어서 그런지 아예 다 올라갔네여..week4폴더에 LP 폴더만 보시면 될것같습니당

✅ 워크북 체크리스트

  • 모든 핵심 키워드 정리를 마쳤나요?
  • 핵심 키워드에 대해 완벽히 이해하였나요?
  • 실습/미션을 수행하였나요?

✅ 컨벤션 체크리스트

  • pr 제목을 컨벤션에 맞게 작성하였나요?
  • pr에 해당되는 이슈를 연결하였나요?
  • 적절한 라벨을 설정하였나요?
  • 코드리뷰를 요청하기 위해 reviewer를 등록하였나요?
  • 닉네임/main 브랜치의 최신 상태를 반영하고 있나요?

@qowldud qowldud added the 💡 Mission 미션 수행 label Apr 10, 2025
@qowldud qowldud self-assigned this Apr 10, 2025
Copy link
Contributor

@duwlsssss duwlsssss left a comment

Choose a reason for hiding this comment

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

고생했어요 👍

console.log("회원가입 성공: ", response.data);
navigate("/login");
} catch (e) {
console.error("에러 발생: ", e);
Copy link
Contributor

Choose a reason for hiding this comment

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

나중에 에러를 시용자에게 어떻게 시각적으로 표현할지 생각해봐도 좋겠어용

Comment on lines +38 to +41
// 오류가 하나라도 있거나, 입력값이 비어있으면 버튼을 비활성화
const isDisabled =
Object.values(errors || {}).some((error) => error.length > 0) || // 오류가 있으면 true
Object.values(values).some((value) => value === ""); // 입력값이 비어있으면 true
Copy link
Contributor

Choose a reason for hiding this comment

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

에러 여부 변수로 뺀 거 좋아요!

Comment on lines +6 to +11
<div className="w-20 h-10 flex justify-center items-center rounded-md bg-black text-white cursor-pointer">
로그인
</div>
<div className="w-20 h-10 flex justify-center items-center rounded-md bg-pink-600 text-white cursor-pointer">
회원가입
</div>
Copy link
Contributor

Choose a reason for hiding this comment

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

여기 navigate가 빠졌어요!

</div>
{/* 소셜 로그인 */}
<div className="w-60 h-10 flex items-center justify-between px-3 border-2 border-white rounded-md mb-5">
<img src="/images/GoogleLogo.svg" alt="google_logo" className="w-6" />
Copy link
Contributor

Choose a reason for hiding this comment

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

애플리케이션 내부에서 동적으로 불러올 이미지는 src/assets/images 폴더 만들어서 넣는 게 좋을 것 같아요!
Vite를 쓸 때 src안에 있는 이미지는 Vite/Webpack이 최적화해서 번들링 최적화를 해주기 때문에
로고, favicon, Open Graph 등의 이미지 등만 public에 넣는 걸 추천합니당

Comment on lines +24 to +30
{step === "email" && (
<EmailInput nextStep={() => setStep("password")} />
)}
{step === "password" && (
<PasswordInput nextStep={() => setStep("profile")} />
)}
{step === "profile" && <ProfileInput />}
Copy link
Contributor

Choose a reason for hiding this comment

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

너무 깔끔해서 기절할 것 같아요...

Comment on lines +6 to +27
const schema = z
.object({
email: z.string().email({ message: "올바른 이메일 형식이 아닙니다." }),
password: z
.string()
.min(8, {
message: "비밀번호는 8자 이상이어야 합니다.",
})
.max(20, {
message: "비밀번호는 20자 이하이어야 합니다.",
}),
confirmPassword: z.string(),
name: z.string().min(1, {
message: "이름을 입력해주세요.",
}),
})
.refine((data) => data.password === data.confirmPassword, {
path: ["confirmPassword"],
message: "비밀번호가 일치하지 않습니다.",
});

export type FormFields = z.infer<typeof schema>;
Copy link
Contributor

Choose a reason for hiding this comment

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

이 파일에서 스키마 부분은 schema 폴더 만들어서 빼는 게 나을 것 같아요!

Copy link

@namgungseok12 namgungseok12 left a comment

Choose a reason for hiding this comment

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

nice job!!

@qowldud qowldud changed the base branch from main to judy/main April 11, 2025 07:49

Choose a reason for hiding this comment

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

고생하셨습니다~!!

@qowldud qowldud merged commit cf04878 into judy/main May 2, 2025
1 check passed
@qowldud qowldud deleted the judy/#20 branch May 6, 2025 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

💡 Mission 미션 수행

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants