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

[황경수] week16 #1065

Conversation

dali1999
Copy link
Collaborator

@dali1999 dali1999 commented May 3, 2024

요구사항

기본

  • 리팩토링 사항 적용

Copy link

vercel bot commented May 3, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
4-weekly-mission ❌ Failed (Inspect) May 3, 2024 1:24am
4-weekly-mission-ursd ❌ Failed (Inspect) May 3, 2024 1:24am

Copy link
Collaborator

@arthurkimdev arthurkimdev left a comment

Choose a reason for hiding this comment

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

마지막 16주차 과제도 수고하셨습니다~

Comment on lines +1 to +8
export const safeGetItem = (key: string) => {
try {
return localStorage.getItem(key);
} catch (error) {
console.error(error);
return null;
}
};
Copy link
Collaborator

Choose a reason for hiding this comment

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

여기서 리턴값이 null로 되어있는 경우에는 키에 대한 값이 없어서 null 일때와 에러가 발생해서 받은 값인 null 경우 구분하기가 어렵기 때문에, 해당 키 값이 없을땐 null / 에러 발생 시 undefined 이렇게 구분해서 리턴해주면 좋습니다~

};

export const passwordTextInputProps = (inputType: string) => ({
type: inputType,
Copy link
Collaborator

Choose a reason for hiding this comment

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

여기서 inputType 값은 password 값이 일반적입니다~

@@ -0,0 +1,17 @@
export const emailTextInputProps = {
type: "text",
Copy link
Collaborator

Choose a reason for hiding this comment

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

여기서 inputType 값은 email 값이 더 일반적입니다.

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input

Comment on lines +35 to 36
const accessToken = safeGetItem("accessToken");
if (accessToken !== null) setToken(accessToken);
Copy link
Collaborator

Choose a reason for hiding this comment

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

지난번 리뷰 사항을 잘 반영해주셨네요 👍

@@ -32,7 +34,7 @@ function SigninForm() {
console.log(accessToken);

if (accessToken) {
localStorage.setItem("accessToken", accessToken);
saveToLocalStorage("accessToken", accessToken);
Copy link
Collaborator

Choose a reason for hiding this comment

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

여기도 반영 굳! 👍

@arthurkimdev arthurkimdev merged commit aa1f487 into codeit-bootcamp-frontend:part3-황경수 May 3, 2024
1 of 3 checks passed
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