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] 로그인 & 회원가입 구현 #98

Merged
merged 63 commits into from
Jun 21, 2024

Conversation

minjeong9919
Copy link
Contributor

🚀 작업 내용

  • 로그인 모달창과 회원가입 페이지를 구현하였습니다.
  • 토스트 컴포넌트 커스텀 했습니다.
  • 리팩토링 작업 완성하였습니다.

📝 참고 사항

  • Oauth 기능은 아직 미완성입니다.
  • 회원가입 약관 동의할 때 체크 표시는 디자인 처럼 stroke 처리하면 체크 안쪽이 안채워져 아래 같이 어색해져서
    image
    fill 처리 해두었습니다.
    image
  • 로그인 모달창과 헤더 연결 또한 이슈가 생겨서 추후 이루어질 예정입니다.
  • 토스트 컴포넌트에서 아이콘은 하얀색으로 채워보려고 했는데 안채워집니다. 만약 아이콘 넣는다면 하얀 배경 없이 들어가야할 것 같습니다.

🖼️ 스크린샷

image

🚨 관련 이슈 (이슈 번호)

✅ 체크리스트

  • Code Review 요청
  • Label 설정
  • PR 제목 규칙에 맞는지 확인

@minjeong9919 minjeong9919 added 📖 Page 페이지 제작 📬 API 서버 api 통신 ✨ Component 기능 개발 labels Jun 20, 2024
@minjeong9919 minjeong9919 self-assigned this Jun 20, 2024
Copy link
Contributor

@bokeeeey bokeeeey 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 +54 to +56
},
body: JSON.stringify(formData),
});
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
},
body: JSON.stringify(formData),
});
},
body: JSON.stringify(formData),
});

json으로 파싱해서 보내는거면 accept는 없어되지않아요?

<div className={cn('auth-section-wrapper')}>
{AUTH_SECTION.map((text, i) => (
<div key={text} className={cn('auth-section')}>
<Link href='/sign-up' className={cn('auth-section-text')}>
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
<Link href='/sign-up' className={cn('auth-section-text')}>
<Link href={ROUTER.AUTH.SUGN_UP} className={cn('auth-section-text')}>

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 87 to 89
},
onBlur: () => handleCheckDuplicatedEmail(),
}),
Copy link
Contributor

Choose a reason for hiding this comment

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

value를 주입하지 않아도 되나요? 저스트 궁금

Copy link
Contributor Author

Choose a reason for hiding this comment

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

지니어스! 근데 value가 아니라 event 객체로 들어오네요! 그래도 바아로 도입

Comment on lines +215 to +222
<InputField
label='닉네임'
placeholder={PLACEHOLDER.NICKNAME}
sizeVariant='md'
labelSize='sm'
errorMessage={errors.nickname?.message}
{...registers.nickname}
/>
Copy link
Contributor

Choose a reason for hiding this comment

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

currentLength={changedNickname.length}

onChange로 value 감지해서 해당 props 내리면
image
이거 나와요우

Copy link
Contributor Author

Choose a reason for hiding this comment

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

오 대박 오 근데 아직 머지 안된 부분 맞죵? 머지 되면 바로 적용 하겠슴니다

Comment on lines +127 to +130
gender: register('gender', {
required: ERROR_MESSAGE.GENDER.required,
setValueAs: (value) => (value === '여자' ? 'FEMALE' : 'MALE'),
}),
Copy link
Contributor

Choose a reason for hiding this comment

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

이건 merge되면 한번 이야기해주세요

disabled={!isValid}
className={cn('button')}
fontSize={24}
backgroundColor={isValid ? 'background-primary' : 'background-gray-40'}
Copy link
Contributor

Choose a reason for hiding this comment

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

이건 버튼컴포넌트 안에 css에 작성하는게 더 나아보여요우

: disabled {
대충 비활성화 상태 색상
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

오호!! 근데 그럼 prop을 통해 background 설정이 불가하지 않나요?!!?

Copy link
Contributor

Choose a reason for hiding this comment

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

disabled상태에서만 적용되는 style이라서 지금 하신거랑 똑같을걸요?

Comment on lines 6 to 8

export default function Page() {
return (
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
export default function Page() {
return (
export default function SignUpPage() {
return (

이름은 표현하는게 좋을거같아요

Copy link
Contributor

@armd482 armd482 left a comment

Choose a reason for hiding this comment

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

수고하셨습니다~

}
};

export const postSignup = async (formData: FormData) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

오호~ formData를 미리 stringify된 걸로 가져오네요~
뭔가 아래 postSignin 함수는 함수 내부에서 string처리하는데 여긴 string으로 처리된 값을 가져오는데, 이 부분 어떻게 생각하시나요?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

postSignin이랑 postSignup의 보내주는 데이터 형식이 다릅니다!! signup은 formdata 형식으로 보내주고, signin은 json 형식이라서요,,

},
body: JSON.stringify(formData),
});
const data = await response.json();
Copy link
Contributor

Choose a reason for hiding this comment

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

구조분해해서 data.data로 리턴하는 게 사용할 때 더 쉬울 것 같아요.
responseData.data.accessToken 이런 식으로 불러오는 것을 responseData.accessToken으로 더 쉽게 불러올 수 있을 것 같아요

Suggested change
const data = await response.json();
const { data } = await response.json();

Copy link
Contributor Author

Choose a reason for hiding this comment

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

엇 그러면 SignInModal내에서 response의 안의 status하고 Message 확인이 어렵지 않을까요..?!

Copy link
Contributor

Choose a reason for hiding this comment

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

include 순서 일치하면 좋을 것 같습니다!

Comment on lines +19 to +21
const handleSignin = () => {
setIsOpenModal(true);
};
Copy link
Contributor

Choose a reason for hiding this comment

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

뭔가 이름이 살짝 아쉬운 느낌이네요. handleOpenSignin? handleOpenModal?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

여긴 저스트 테스트 페이지라서 임의로 지어봤답니당 😆 로그인은 모달창이라 아마 이 페이지는 삭제될 거예요!!

Comment on lines 3 to 4
margin: 0 auto;
margin-bottom: 6rem;
Copy link
Contributor

Choose a reason for hiding this comment

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

합쳐서 쓸 수 있지 않을까요...?

Suggested change
margin: 0 auto;
margin-bottom: 6rem;
margin: 0 auto 6rem;

Comment on lines 13 to 14
font-size: 3rem;
font-weight: bold;
Copy link
Contributor

Choose a reason for hiding this comment

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

이것도 font에 등록하는 게 좋을 것 같아요.(글씨체 pretendard 아닌가요?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

맞아요!! 알고보니 파일 안에 정의되어있엇군뇨,,

Copy link
Contributor

@Young2un Young2un 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
Contributor

Choose a reason for hiding this comment

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

고양이 뚫렸네여?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

오모낫 혹시 뚫리면 문제가 될 수 있을까요,,,!?!??!?!

Comment on lines 32 to 38
.no-show {
display: none;
}

.checkbox-input {
display: none;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

합쳐서 적을 수 있겠다 정도,,?

Copy link
Contributor

Choose a reason for hiding this comment

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

와 이게 커스텀 한건가요? 싱기하다

Copy link
Contributor Author

Choose a reason for hiding this comment

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

전 그저 복붙만 했을 뿌운,,

Comment on lines 55 to 57
} catch (error) {
console.error('로그인 요청 실패', error);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

여기는 console찍혀도 될랑가용?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

어머머머 센스쟁이 바아로 수정 갑니닷

Copy link
Contributor

@ggjiny ggjiny left a comment

Choose a reason for hiding this comment

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

고생 많으셨습니다 👏👏

@@ -27,6 +30,7 @@ export default async function RootLayout({
<body>
<Providers>
<HydrationBoundary state={dehydrate(queryClient)}>
<ToastContainer autoClose={2000} theme='dark' position='top-center' transition={Zoom} />
Copy link
Contributor

Choose a reason for hiding this comment

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

요거는 토스트 사용하려면 꼭 있어야하는 부분일까요?! 토스트 위치가 밑에 있어도 괜찮아보이긴해요🤔

CONFIRM_PASSWORD: '비밀번호를 한번 더 입력해주세요',
NICKNAME: '닉네임을 입력해주세요',
PHONE_NUMBER: '휴대폰 번호 (-없이)를 입력해주세요',
BIRTHDAY: 'YYYY / MM / DD',
Copy link
Contributor

Choose a reason for hiding this comment

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

아까도 말씀드렸는데 여기를 YYYYMMDD로 하던지 통일시키는게 좋아보여요~!

Copy link
Contributor

Choose a reason for hiding this comment

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

👍👍

@minjeong9919 minjeong9919 merged commit c036801 into develop Jun 21, 2024
@minjeong9919 minjeong9919 deleted the 82-feat-로그인-회원가입-구현 branch June 23, 2024 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📬 API 서버 api 통신 ✨ Component 기능 개발 📖 Page 페이지 제작
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[Feat] 로그인 & 회원가입 구현
5 participants