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

[김은재] Week14 #459

Conversation

rladmswo1715
Copy link
Collaborator

@rladmswo1715 rladmswo1715 commented May 20, 2024

요구사항

기본

  • 로그인, 회원가입 페이지를 만들어 주세요.

심화

  • 로그인, 회원가입 기능에 react-hook-form을 활용해 주세요.

주요 변경사항

멘토에게

@rladmswo1715 rladmswo1715 added the 매운맛🔥 뒤는 없습니다. 그냥 필터 없이 말해주세요. 책임은 제가 집니다. label May 20, 2024
Copy link
Collaborator

@choinashil choinashil 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 +46 to +48
ref={() => {
selectedFoler.current[i] = navItem.id;
}}
Copy link
Collaborator

Choose a reason for hiding this comment

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

ref 를 여기서 전달하는건 어떤 목적이에요??

Comment on lines +9 to +15
const SHARE_OPTION = [
{
keyId: "kakaotalk",
img: icon_share_kakao,
imgAlt: "카카오톡 아이콘",
buttonName: "카카오톡",
},
Copy link
Collaborator

Choose a reason for hiding this comment

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

훨씬 좋네요 👍🏽

return (
<>
{SHARE_OPTION.buttonName.map((shareOptionBtn, i) => {
{SHARE_OPTION.map((itme) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

오타!

Suggested change
{SHARE_OPTION.map((itme) => {
{SHARE_OPTION.map((item) => {

Comment on lines +11 to +32
const snsInfo = [
{
url: "https://www.facebook.com/",
img: icon_facebook,
imgAlt: "페이스북 아이콘",
},
{
url: "https://twitter.com/",
img: icon_twitter,
imgAlt: "트위터 아이콘",
},
{
url: "https://www.youtube.com/",
img: icon_youtube,
imgAlt: "유튜브 아이콘",
},
{
url: "https://www.instagram.com/",
img: icon_instagram,
imgAlt: "인스타그램 아이콘",
},
];
Copy link
Collaborator

Choose a reason for hiding this comment

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

이 부분은 컴포넌트 렌더링 될 때마다 매번 선언될 필요가 없어서 컴포넌트 바깥으로 빼도 될 것 같아요!

validate?: (value: string) => Promise<boolean | string>;
}

let InputOption: IInputType = {
Copy link
Collaborator

Choose a reason for hiding this comment

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

재할당 할 일이 없다면 const 를 사용해주세요!

Copy link
Collaborator

Choose a reason for hiding this comment

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

상수의 경우 따로 타입 (IInputType) 정의하지 않고 as const 키워드를 사용할 수도 있습니다

  1. 타입을 명시적으로 정의하지 않고 타입스크립트가 추론하도록 했을 때와
  2. 타입을 명시적으로 정의했을 때와 (지금 작성한 방식)
  3. as const 를 사용했을 때

의 타입이 어떻게 달라지는지 확인해보세요!

Comment on lines +32 to +40
useEffect(() => {
try {
const token = localStorage.getItem("userToken");
setAuth(token);
} catch (error) {
console.error("Error fetching token:", error);
}
}, []);
if (auth) router.replace("/folder");
Copy link
Collaborator

Choose a reason for hiding this comment

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

이 부분 코드 반복되는데 커스텀훅으로 분리할 수 있겠네요!

margin-top: 24px;
`;

export const PassWrodBox = styled.div`
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
export const PassWrodBox = styled.div`
export const PassWordBox = styled.div`

Comment on lines +77 to +97
/*.
.password-wrap > .pwd-eye-on {
background-image: url('/img/icon/eye-on.png');
height: 10.91px;
}

.validation{
padding-top: 6px;
font-size: 14px;
font-weight: 400;
color: var(--var-test-red);
line-height: 16.8px;
}

.emailBlank, .emailFormCheck, .emailCheck, .pwdBlank, .pwdCheck {
padding-top: 6px;
display: block;
}


*/
Copy link
Collaborator

Choose a reason for hiding this comment

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

미사용 코드 삭제!

@@ -1,5 +1,7 @@
export interface ButtonProps {
children: string;
btnType?: "button" | "submit" | "reset" | undefined;
Copy link
Collaborator

Choose a reason for hiding this comment

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

옵셔널 (?) 로 지정했다면 undefined 일 수 있다는 의미이므로 undefined 를 작성하지 않아도 됩니다

Suggested change
btnType?: "button" | "submit" | "reset" | undefined;
btnType?: "button" | "submit" | "reset";

Comment on lines +16 to +17
pageType: string;
type: string;
Copy link
Collaborator

Choose a reason for hiding this comment

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

pageType 은 'signUp' | 'signIn' 이 사용되는 것 같고
type 도 사용하는 값이 몇 개 중 정해져있는 것 같은데
그렇다면 string 보다는 문자열 유니온으로 타입을 좁히는 것이 더 정확하게 타입스크립트를 사용하는 방법입니다!

@choinashil choinashil merged commit 3343fc8 into codeit-bootcamp-frontend:part3-김은재 May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
매운맛🔥 뒤는 없습니다. 그냥 필터 없이 말해주세요. 책임은 제가 집니다.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants