-
Notifications
You must be signed in to change notification settings - Fork 1
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
[Feat/#335] 클래스 생성 시 각 단계별 새로고침 대응 & 리뷰 순서 최신순으로 정렬 #337
Conversation
const Button = ({ variant, disabled, customStyle, onClick, children }: ButtonProps) => { | ||
const Button = ({ variant, disabled, customStyle, children, ...props }: ButtonProps) => { | ||
return ( | ||
<button | ||
type="button" | ||
css={[buttonStyle, buttonSize[variant], disabled && disabledStyle, customStyle]} | ||
onClick={onClick} | ||
disabled={disabled}> | ||
disabled={disabled} | ||
{...props}> |
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.
여길 이렇게 하신 이유가있나요?
여러 속성을 받기위해 props를 추가하신건가요? 그렇다면 onClick을 지운 이유도 있을까요?
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.
맞슴다! 추후에 어떤 버튼 속성이 추가된다면, 기존 방식대로라면 prop이 하나하나 추가될 것 같아서요!
{/* moimReviewList안에 date를 이용해서 sort로 최신순으로 정렬 */} | ||
{moimReviewList | ||
?.sort((a, b) => { | ||
const dateA = a.date ? new Date(a.date).getTime() : 0; // date가 없으면 0으로 설정 | ||
const dateB = b.date ? new Date(b.date).getTime() : 0; // date가 없으면 0으로 설정 | ||
return dateB - dateA; // 최신순 정렬 | ||
}) |
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.
서버에서 Date를 내려주고 있긴합니다.
다만, 기획 쌤들이 최신순으로 배치되기를 원하시더라구요!
그래서 제가 따로 정렬했는데, 사실 서버에서 최신으로 정렬해서 내려준다면 훨씬 좋을 것 같아요!
서버 쌤들께 문의드려보겠습니다 ㅎㅎ
width: 3rem; | ||
height: 3rem; |
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.
여기 width, height를 제가 넣어놓은게 실제 아이콘 크기는 3rem이 아니긴 한데 디자인쪽에서 아이콘이 너무 작아서 모바일에서 터치할 때 잘 안된다고 해서 터치 영역을 일부러 3rem으로 잡아놓은건데 혹시 삭제하신 이유가 있으신가요?
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 Changes
📢 To Reviewers
📸 스크린샷 or 실행영상