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

Closed
wants to merge 51 commits into from

Conversation

minjeong9919
Copy link
Contributor

🚀 작업 내용

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

📝 참고 사항

  • Oauth 기능은 아직 미완성입니다.
  • 회원가입 약관 동의할 때 체크 표시는 디자인 처럼 stroke 처리하면 체크 안쪽이 안채워져 아래 같이 어색해져서
    image
    fill 처리 해두었습니다.
    image
  • 로그인 부분에서 눈알을 누르면 모달창이 아예 꺼지는 이슈 발견했습니다. 이 부분 머지전까지 해결해볼게요
  • 추후 accessToken은 Tanstack query로 관리해야해서 이 부분은 해당 브랜치 머지 후 추가적으로 수정 들어갈 것 같습니다.
  • 로그인 모달창과 헤더 연결 또한 이슈가 생겨서 추후 이루어질 예정입니다.
  • 토스트 컴포넌트에서 아이콘은 하얀색으로 채워보려고 했는데 안채워집니다. 만약 아이콘 넣는다면 하얀 배경 없이 들어가야할 것 같습니다.

🖼️ 스크린샷

🚨 관련 이슈 (이슈 번호)

✅ 체크리스트

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

@minjeong9919 minjeong9919 added 📖 Page 페이지 제작 📬 API 서버 api 통신 ✨ Component 기능 개발 labels Jun 18, 2024
@minjeong9919 minjeong9919 self-assigned this Jun 18, 2024
@minjeong9919 minjeong9919 linked an issue Jun 18, 2024 that may be closed by this pull request
package.json Outdated
@@ -24,6 +24,7 @@
"react-colorful": "^5.6.1",
"react-dom": "^18",
"react-hook-form": "^7.51.4",
"react-router-dom": "^6.23.1",
Copy link
Contributor

Choose a reason for hiding this comment

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

next.js에서 react-router-dom사용은 좀 찾아보니까 일반적이진 않은거같아요
충돌문제도 있고 해서 이건 다른 방법을 찾아보거나,
주강사님이나 멘토님이 사용 ok하면 사용하는게 좋을거같스빈다

Copy link
Contributor Author

Choose a reason for hiding this comment

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

보니까 router-dom 설치만 하고 사용은 안한 것 같네요 useRouter 때문에 깔았던 것 같은데 'next/navigation'에 있는 useRouter로 사용했어요! 이 부분 uninstall 하겠습니다!

public/index.ts Outdated
@@ -4,6 +4,11 @@ export { default as EyeOffIcon } from './svgs/eyeOff.svg';
export { default as EyeOnIcon } from './svgs/eyeOn.svg';
export { default as LogoIcon } from './svgs/logo.svg';
export { default as SearchIcon } from './svgs/search.svg';

export { default as GitIcon } from '@/public/svgs/gitHub.svg';
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 as GitIcon } from '@/public/svgs/gitHub.svg';
export { default as GitIcon } from '@/public/svgs/github.svg';

Copy link
Contributor

Choose a reason for hiding this comment

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

github 아이콘과 git 아이콘은 서로 다른걸로 알고있어요 더 명확히 사용하는게 좋을거같읍니다

Copy link
Contributor Author

Choose a reason for hiding this comment

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

옹 그렇군여 네넹 바로 수정하겠습니다

@@ -0,0 +1,51 @@
import { FetchSigninInfoTypes } from '@/types';
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
import { FetchSigninInfoTypes } from '@/types';
import type { FetchSigninInfoTypes } from '@/types';

const data = await response.json();
return data;
} catch (error) {
throw new Error('회원가입 실패!');
Copy link
Contributor

Choose a reason for hiding this comment

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

catch로 error을 받아오도록 만드셨으면 new Error을 생성할 필요 없이
catch로 들어오는 error을 던져줘도 되요

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 +25 to +29
headers: {
accept: 'application/json',
},
body: 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
headers: {
accept: 'application/json',
},
body: formData,
});
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(formData),
});

이렇게 보내야하지 않나요? 처음보는 방식이네유

Copy link
Contributor Author

Choose a reason for hiding this comment

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

보내는 바디 형식이 form-data 형식이라 저렇게 보냈어요!! 혹시 몰라서 Json.stringify로 시도해봤는데 에러 뜨네욤,,

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

@minjeong9919 minjeong9919 Jun 19, 2024

Choose a reason for hiding this comment

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

아 네넵 그러네요 header의 content type 으로 json이 들어가면 안되겠네요! 이 부분은 Formdata 타입으로 맞춰놓겠습니다!

Copy link
Contributor

Choose a reason for hiding this comment

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

요소가 form보다는 checkbox에 더 가까운거같아요

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 18 to 20
.not-checked {
color: red;
}
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.

inputs가 아니라 form이 되어야 맞는거같아요

Copy link
Contributor Author

Choose a reason for hiding this comment

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

이렇게 가는건 어떠신가요?

  • Signup -> SignupForm
  • SignupInputs는 그대로

SignupForm으로 바꾸면 Signup 컴포넌트 이름이 애매해져서 이런 식으로 생각해봤습니다!

isAgreementAllChecked: boolean;
setIsAllValid: Dispatch<SetStateAction<boolean>>;
}
export default forwardRef<HTMLFormElement, SignupInputProps>(function SignupInputs(
Copy link
Contributor

Choose a reason for hiding this comment

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

혹시 forwardRef가 필요한 경우가 있을까요?
외부에서 참조하고있는것 같지 않아서 여쭤옵니다

Copy link
Contributor Author

Choose a reason for hiding this comment

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

현재 Signup 컴포넌트에서 ref 참조하고 있습니다! 회원가입의 폼 제출 버튼은 SignupInputs 컴포넌트의 외부에 있기 때문에 ref를 통해 form을 참조함으로써 외부로부터 제출이 가능하게끔 만들었습니다!

Copy link
Contributor

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
📬 API 서버 api 통신 ✨ Component 기능 개발 📖 Page 페이지 제작
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

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