-
Notifications
You must be signed in to change notification settings - Fork 39
[배민지] refactor/sprint5 #192
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
[배민지] refactor/sprint5 #192
The head ref may contain hidden characters: "react-\uBC30\uBBFC\uC9C0-sprint5"
Conversation
…ithub-actions [Fix] delete merged branch github action
fix: 활성화된 네브 버튼 구현 + 주석 정리
addiescode-sj
left a comment
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도 수고하셨습니다! 👍
주요 리뷰 포인트
- 의미가 명확한 props만 남기기
- 재사용성을 위해 로직을 커스텀 훅으로 분리하기
- 리턴문 깔끔하게 유지하기
| const MenuItem = styled(Menu.Item)` | ||
| display: block; | ||
| padding: 10px 16px; | ||
| font-size: 16px; | ||
| background-color: white; | ||
| color: #1f2937; | ||
| cursor: pointer; | ||
|
|
||
| &:hover { | ||
| background-color: #f3f4f6; | ||
| } | ||
| `; |
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.
Headless UI로 기본적인 접근성 및 기능을 붙이고 스타일링만 재정의하시는군요 :) 좋은 접근입니다! :)
| useEffect(() => { | ||
| const updateVisibleCount = () => { | ||
| const width = window.innerWidth; | ||
|
|
||
| if (width >= 1200) { | ||
| // 데스크탑 | ||
| setVisibleCount(10); | ||
| } else if (width >= 768) { | ||
| // 태블릿 | ||
| setVisibleCount(6); | ||
| } else { | ||
| // 모바일 | ||
| setVisibleCount(4); | ||
| } | ||
| }; | ||
|
|
||
| updateVisibleCount(); // 처음 한 번 실행 | ||
| window.addEventListener("resize", updateVisibleCount); | ||
|
|
||
| return () => window.removeEventListener("resize", updateVisibleCount); | ||
| }, []); |
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.
이런 로직은 반응형 분기가 필요할때마다 재사용되지않을까요? 커스텀 훅으로 분리해봅시다!
| onChange={(e) => { | ||
| setPage(1); | ||
| if (e.target.value === "recent") handleNewestClick(); | ||
| if (e.target.value === "favorite") handleFavoriteClick(); | ||
| }} |
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.
항상 리턴문은 깔끔하게 작성할수있도록 습관을 들여볼까요? 인라인 함수로 작성하기보단, object mapper를 활용하거나 내부 함수로 작성하는 편이 좋을것같네요.
체크리스트 [기본]
중고마켓
중고마켓 페이지 주소는 “/items” 입니다.
페이지 주소가 “/items” 일때 상단네비게이션바의 '중고마켓' 버튼의 색상은 “3692FF”입니다.
상단 네비게이션 바는 이전 미션에서 구현한 랜딩 페이지와 동일한 스타일로 만들어 주세요.
상품 데이터 정보는 https://panda-market-api.vercel.app/docs/#/ 에 명세된 GET 메소드 “/products” 를 사용해주세요.
'상품 등록하기' 버튼을 누르면 “/additem” 로 이동합니다. ( 빈 페이지 )
전체 상품에서 드롭 다운으로 “최신 순” 또는 “좋아요 순”을 선택해서 정렬을 할 수 있습니다.
중고마켓 반응형
베스트 상품
Desktop : 4개 보이기
Tablet : 2개 보이기
Mobile : 1개 보이기
전체 상품
Desktop : 12개 보이기
Tablet : 6개 보이기
Mobile : 4개 보이기
체크리스트 [심화]
멘토에게
css 분리가 필요한데
styled-components로 작성하는 방식이랑
css파일로 따로 분리하는 방식을 같이 사용해도 괜찮을까요?
스타일은 일정한게 좋을 거같긴한데 css가 너무 짧을때는 styled-components가 가독성이 좋아보여서 고민스럽네요
기존에 주신 코드리뷰는 반영하기 전입니다
리팩토링 해보겠습니다!!