-
Notifications
You must be signed in to change notification settings - Fork 4
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
콘텐츠, 크리에이터 목록이 비어있는 경우 처리 #305
base: dev
Are you sure you want to change the base?
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.
👍
@@ -8,7 +8,20 @@ const CardList = ({ | |||
type: 'creator' | 'content'; | |||
children: ReactNode; | |||
}) => { | |||
return <div className={style.listContainer({ type: type })}>{children}</div>; | |||
const hasContents = Children.toArray(children).length !== 1 ? 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.
이 부분
const hasContents = Children.toArray(children).length !== 1;
이렇게 변경하면 더 깔끔할 것 같아요~~
return ( | ||
<> | ||
{hasContents ? ( | ||
<div className={style.listContainer({ type: type })}>{children}</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.
key value 같으니 type만 적어도 무방할 것 같습니다~~ ㅎㅎ
? `콘텐츠가 존재하지 않습니다.` | ||
: `크리에이터가 존재하지 않습니다`} |
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.
통일성을 위해 변수를 사용하지 않으니 백틱(`)이 아닌 작은 따옴표(')로 변경하면 깔끔할 것 같아요~~
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.
👍👍👍
if (!getContents) { | ||
return <Spinner size="huge" />; | ||
} |
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.
스피너 굿굿 나중에 에러 바운더리랑 서스펜스도 도입하면 좋을듯~~!
💡 이슈 번호
close #302
📖 작업 내용
✅ PR 포인트
📸 스크린샷