-
Notifications
You must be signed in to change notification settings - Fork 44
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
[김은재] Week15 #466
The head ref may contain hidden characters: "part3-\uAE40\uC740\uC7AC-week15"
[김은재] Week15 #466
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
은재님 수고 많으셨습니다! 👍🏽
남은 미션들도 화이팅이에요!!
navId: string | string[] | undefined, | ||
userToken: string | undefined |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
undefined 인 경우 아래와 같이 선택적 프로퍼티로 작성할 수도 있습니다!
navId: string | string[] | undefined, | |
userToken: string | undefined | |
navId?: string | string[], | |
userToken?: string |
) => { | ||
let query = "/api/links"; | ||
if (navId) { | ||
query += `?folderId=${navId}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이렇게 넣는다면 navId 는 string[] 타입인 경우보다는 string 타입인 경우만 해당될 것 같네요
19라인에서는 string | string[]
으로 정의되어있는데 string[] 으로 들어오는 케이스가 있는지 확인 후, 없다면 타입을 좁혀주시면 좋을 것 같습니다!
다른 부분도 마찬가지
@@ -39,6 +43,7 @@ const LinkAddContent = () => { | |||
<S.Content> | |||
<S.FolderList> | |||
{navList.map((navItem: INavItem, i) => { | |||
console.log(navItem); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR 올린 후 불필요한 코드가 있는지 꼭 확인해주세요
console.log(navItem); |
isCurrentNav={ | ||
pageNavId && navItem.id?.toString() === pageNavId[0] | ||
? true | ||
: false | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
조건문 자체가 boolean 이므로 간단하게 변경해볼수있겠네요
isCurrentNav={ | |
pageNavId && navItem.id?.toString() === pageNavId[0] | |
? true | |
: false | |
} | |
isCurrentNav={ | |
pageNavId && navItem.id?.toString() === pageNavId[0] | |
} |
|
||
interface NavItemProps { | ||
navName?: string; | ||
navId?: number; | ||
onClick: (navId: number) => void; | ||
//onClick: (navId: number) => void; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
미사용 코드 삭제!
const handleLogout = () => { | ||
window.localStorage.removeItem("userToken"); | ||
|
||
router.reload(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
새로고침 할 수도 있고,
전역에서 로그인 여부를 관리하는 상태를 참조하도록 해도 될 것 같아요
로그인 할 때 토큰 세팅하면서 해당 상태도 같이 true 로 변경해주고,
로그아웃할 때는 토큰 삭제하면서 같이 false 로 변경
이러면 새로고침 하지 않아도 상태 변경에 따라 새로고침 없이도 화면에 반영될 수 있을거고요
꼭 수정해야한다는 의미는 아니고 다양한 방법이 있다는 정도로 이해하시면 됩니다
id: userInfo.id, | ||
name: userInfo.name, | ||
image_source: userInfo.image_source, | ||
email: userInfo.email, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
userInfo 에 id, name, image_source, email 만 포함되어있다면 아래처럼 작성할 수도 있겠네요
id: userInfo.id, | |
name: userInfo.name, | |
image_source: userInfo.image_source, | |
email: userInfo.email, | |
...userInfo |
// run build 에러때문에 잠시 작성 | ||
const handleSearchChange = (value: string) => {}; | ||
const handleDeleteBtn = () => {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SearchBar 에서 꼭 필요한 prop 맞나요?? 아니라면 SearchBar 의 prop 타입에서 두 함수를 옵셔널로 처리해도 될 것 같아요
@@ -60,6 +52,11 @@ const GlobalStyle = createGlobalStyle<GlobalStyleProps>` | |||
cursor: pointer; | |||
background: none; | |||
} | |||
|
|||
a{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
작은 여백도 꼼꼼하게 챙기기!
a{ | |
a { |
} | ||
`; | ||
|
||
export const EmailBox = styled.div` | ||
margin-top: 24px; | ||
`; | ||
|
||
export const PassWrodBox = styled.div` | ||
export const PassWordBox = styled.div` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
password 는 한 단어이므로 중간에 대문자 대신 전체 소문자로 작성해야해요
export const PassWordBox = styled.div` | |
export const PasswordBox = styled.div` |
요구사항
기본
심화
주요 변경사항
스크린샷
멘토에게