-
Notifications
You must be signed in to change notification settings - Fork 37
[정혜연] sprint8 #280
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
[정혜연] sprint8 #280
The head ref may contain hidden characters: "React-\uC815\uD61C\uC5F0-sprint8"
Conversation
해당하는 부분들이 어디인지 github에 코멘트로 남겨주셔야 쉽게 파악할 수 있을 것 같아요. |
기존 "React-정혜연" 브랜치에 sprint-6 내용이 있는데, 이를 pull 받고 sprint-8 브랜치를 만든 것이 아니라 커밋 헤드가 분리 돼서 머지 시도가 되지 않는 걸로 보여요. |
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.
타입스크립트 파일로 변환해보면 좋을 것 같아요.
const [isDropdownVisible, setIsDropdownVisible] = useState(false); | ||
|
||
const toggleDropdown = () => { | ||
setIsDropdownVisible(!isDropdownVisible); |
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.
setIsDropdownVisible((prev) => !prev)
이렇게 간단한 경우는 문제 없지만, 로직이 복잡해지면 이전 상태값을 받는다는 보장이 없어서 prev 값을 가져와서 변경하는게 더 안전해요. (참고)
onSortSelection: (sortOption: string) => void; | ||
} | ||
|
||
function DropdownMenu({ onSortSelection }: onSortSelectionValue) { |
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.
현재 드롭다운은 최신순, 인기순 만 담을 수 있는 컴포넌트인데,
많은 프로젝트에서 드롭다운 컴포넌트를 동일한 ui를 가지고 다양한 곳에서 사용하기도 해서
다른 선택지가 들어오는 경우에도 사용할 수 있는 조금 더 일반적인 ui 컴포넌트를 만든다면 어떻게 만들지 고민해보고 리팩토링 해봐도 좋을 것 같아요.
return ( | ||
<Container> | ||
<ItemProfileSection product={product} /> | ||
|
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.
아래에도 있는데 불필요한 여백으로 보여요.
해당 부분들 아직 해소되지 않으셨으면 저한테 디스코드 메세지 남겨주셔요. 시간 조율해서 같이 봐 드릴게요. |
요구사항
기본
심화
주요 변경사항
스크린샷
멘토에게