-
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
[김법균] week11 #359
The head ref may contain hidden characters: "part2-\uAE40\uBC95\uADE0-week8"
[김법균] week11 #359
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.
고생하셨습니다. 👍
- CSS가 깔끔하네요!
- 로직을 함수와 파일들을 잘 나눠주셨네요.
return ( | ||
<button onClick={onClick} className={styles.btn}> | ||
<button onClick={onClick} className={`${className} ${styles.btn}`}> |
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 UTIL_BUTTONS_PROPS = [ | ||
{ | ||
imgSrc: shareIcon, | ||
btnText: '공유', | ||
alt: '공유 아이콘', | ||
id: 1, | ||
onClick: onShare, | ||
}, | ||
|
||
{ | ||
imgSrc: penIcon, | ||
btnText: '이름 변경', | ||
alt: '이름 변경 아이콘', | ||
id: 2, | ||
onClick: onFolderNameChangeClick, | ||
}, | ||
{ | ||
imgSrc: deleteIcon, | ||
btnText: '삭제', | ||
alt: '삭제 아이콘', | ||
id: 3, | ||
onClick: onFolderDeleteClick, | ||
}, | ||
]; |
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.
컴포넌트 안에 이런 고정 constant를 넣어두면 안됩니다.
컴포넌트의 특징과 그 내부의 변수가 어떻게 생성되는지 알아보시면 좋을 것 같습니다.
const DROPDOWN_LIST_ITEMS = [ | ||
{ text: '삭제하기', onClick: handleLinkDelete }, | ||
{ text: '폴더에추가', onClick: handleAddToFolder }, | ||
]; |
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.
위와 동일하게 상수값은 컴포넌트가 아닌 다른 곳에서 선언해주는 것이 좋습니다.
<div className={styles.modalContainer}> | ||
<div className={styles.modalWrapper}> | ||
<button onClick={onClose} className={styles.closeButton}></button> | ||
{children} |
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.
children을 잘 써주셨네요. 👍
</div> | ||
<ul className={styles.folderList}> | ||
{curFolders.map((folder) => ( | ||
<li> |
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.
map으로 생성되는 component는 key값을 꼭 지정해주시는 편이 좋습니다.
요구사항
기본
주요 변경사항
스크린샷
멘토에게