Skip to content
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

✨ feat: 로그인 및 회원가입 페이지 구현 #47

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

junyeokk
Copy link
Collaborator

@junyeokk junyeokk commented Feb 12, 2025

🔨 테스크

  • 로그인/회원가입 페이지의 기본 레이아웃 구현
  • 브랜딩 배너, 인증 폼 컴포넌트 좌우 분리
  • 자연스러운 애니메이션 구성
  • 소셜 로그인 버튼 UI 구현
  • 적절한 컴포넌트 분리

📋 작업 내용

UX 최적화

페이지 초기 진입 시에는 framer-motion을 활용해 왼쪽 배너(AuthBanner)가 슬라이드되며 나타나도록 했지만, 이후 로그인/회원가입 폼 전환 시에는 반복적인 애니메이션으로 인한 사용자 피로도를 우려해 AuthBanner가 움직이는 애니메이션을 제거했습니다. "Write Today, Shape Tomorrow"라는 슬로건의 페이드인 애니메이션은 유지했으나, 피드백을 통해 제거 여부를 결정할 것입니다.

컴포넌트 분리 및 구조화

로그인과 회원가입 기능 각각의 확장성을 고려했습니다. 초기에는 하나의 AuthForm 컴포넌트 내에서 prop으로 구분하여 처리하려 했지만 향후 각 기능이 독립적으로 커질 것을 고려해 AuthSignInFormAuthSignUpForm으로 분리했습니다. 아직 백엔드 파트에서 소셜 로그인에 대한 설계 및 구현이 완료되지 않아 우선 로그인 시에만 소셜 로그인에 대응하는 Button을 구현했습니다.

레이아웃 구조

레이아웃은 크게 두 부분으로 나누어 구현했습니다. 왼쪽의 브랜딩 배너(AuthBanner)는 서비스의 슬로건을 나타내었습니다. 오른쪽에는 실제 로그인 혹은 회원가입을 할 수 있는 인증 폼이 위치합니다.
스크린샷 2025-02-13 오전 1 02 09

소셜 로그인 아이콘 컴포넌트화

소셜 로그인 아이콘들은 TypeScript 컴포넌트로 구현했습니다. SVG를 TypeScript 컴포넌트로 만든 이유는 아래와 같습니다.

  • props의 타입을 명확히 정의해 잘못된 속성 전달을 방지할 수 있습니다.
  • className이나 style props를 통해 쉽게 스타일을 변경할 수 있습니다.
  • 아이콘의 크기나 색상을 상황에 맞게 쉽게 변경할 수 있습니다.

참고사항

  • 코드는 /components/auth/ 폴더 밑에 구현되어 있어요
    • 이름으로 어떤 컴포넌트인지 판단하기 쉽게 depth는 없게 만들어놓았고 네이밍 컨벤션도 얼추 맞추어놓았어요
  • 로그인이랑 회원가입은 폼을 따로 나누었어요 (AuthSignInForm.tsx, AuthSignUpForm.tsx)
    • 원래는 컴포넌트 하나(AuthForm.tsx)로 두고 삼항 연산자로 하다가 뭔가 나중가면 엄청 복잡해질 수도 있을 것 같아 나눴습니다
  • 소셜 로그인 버튼은 만들어두었는데, 향후 백엔드의 작업에 따라 제거 및 추가하면 될 것 같습니다
  • 로그인 폼은 (소셜 로그인 제외) 더 이상 바뀌지 않아도 괜찮을 것 같은데, 회원가입 폼에서 더 필요한 정보가 있거나, 필요 없는 정보는 제거하는 식으로 (소셜 로그인과 마찬가지로) 백엔드 작업에 따라 조정해도 되겠습니다!
  • 셀프 피드백
    • 적다가 생각났는데 회원가입 폼 누를 때 옆에 있는 슬로건도 그에 맞게 좀 뭔가 welcome 한 듯한 의미가 담긴 걸로 바뀌면 더 좋을 것 같네요
    • 로그인 회원가입 바뀔 때에도 폼도 애니메이션 들어가면 더 완성도 높아질 것 같구요

📷 스크린 샷

2025-02-1312 29 27-ezgif com-video-to-gif-converter

- 모달 기반 임시 로그인 기능 제거
- /signin, /signup 페이지 라우팅 추가
- 사이드바와 네비게이션의 로그인 관련 로직 관리
- 페이지 컴포넌트 네이밍 컨벤션 통일
@junyeokk junyeokk added the ✨ Feature 기능 구현 label Feb 12, 2025
@junyeokk junyeokk self-assigned this Feb 12, 2025
@junyeokk junyeokk requested a review from jungmyunggi February 12, 2025 15:58
@junyeokk junyeokk marked this pull request as draft February 12, 2025 15:59
@junyeokk junyeokk marked this pull request as ready for review February 13, 2025 01:31
Copy link
Collaborator

@jungmyunggi jungmyunggi 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 +30 to +52
<motion.span initial={{ opacity: 0 }} animate={{ opacity: 1 }} transition={{ duration: 0.5, delay: 0.6 }}>
Write
</motion.span>{" "}
<motion.span initial={{ opacity: 0 }} animate={{ opacity: 1 }} transition={{ duration: 0.5, delay: 0.8 }}>
Today,
</motion.span>
<br />
<motion.span initial={{ opacity: 0 }} animate={{ opacity: 1 }} transition={{ duration: 0.5, delay: 1 }}>
Shape
</motion.span>{" "}
<motion.span initial={{ opacity: 0 }} animate={{ opacity: 1 }} transition={{ duration: 0.5, delay: 1.2 }}>
Tomorrow
</motion.span>
</motion.h1>

<motion.p
className="mt-4 max-w-md text-xl text-white/90"
initial={{ opacity: 0, y: 20 }}
animate={{ opacity: 1, y: 0 }}
transition={{ duration: 0.5, delay: 1.4 }}
>
당신의 성장을 기록하는 공간
</motion.p>
Copy link
Collaborator

Choose a reason for hiding this comment

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

p4) 위에 url이랑 여기 나오는 글들은 머지전에 교체하시는건가요?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

음 어떤 url 말씀하시는걸까요

Copy link
Collaborator

Choose a reason for hiding this comment

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

위에 이미지 url입니다

Comment on lines +12 to +18
const handleSocialLogin = () => {
toast({
title: "서비스 준비 중",
description: "서비스가 현재 개발 중입니다. 곧 만나요!",
duration: 3000,
});
};
Copy link
Collaborator

Choose a reason for hiding this comment

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

p3)아래 버튼을 눌러도 해당 토스트가 안나오네요

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

앗.. 변경해놓겠습니다

Comment on lines +12 to +36
return (
<>
<AuthCard title="로그인" description="로그인을 해주세요">
<form className="space-y-4">
<div className="space-y-2">
<Input type="email" placeholder="이메일을 입력하세요" required />
<Input type="password" placeholder="비밀번호를 입력하세요" required />
</div>
<Button className="w-full" type="submit">
로그인
</Button>
</form>
<AuthSocialLoginButtons />
<div className="mt-4">
<Button
variant="link"
className="text-muted-foreground underline underline-offset-4 h-auto p-0"
onClick={() => navigate("/signup", { state: { from: location.pathname } })}
>
계정이 없으신가요?
</Button>
</div>
</AuthCard>
</>
);
Copy link
Collaborator

Choose a reason for hiding this comment

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

p3) 비회원 사용자를 위해서 서비스 홈으로 가는 버튼이 있었으면 좋을것 같습니다.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

아하 비회원 사용자 누르면 guest라고 사용자가 떠야 할까요 ?? 아니면 그냥 따로 처리 안 하고 서비스 홈으로만 돌아가는걸 넣으면 될까요??

팀 내에서 이런 이야기를 안 해봤던 것 같은데(제가 놓쳤다면 죄송합니다), 전체 회의를 해봐서 정하는 방법도 있을 것 같네요

Copy link
Collaborator

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
✨ Feature 기능 구현
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants