[김태홍] sprint5#55
Merged
wseungjin merged 1 commit intocodeit-sprint-fullstack:react-김태홍from Jun 3, 2025
Hidden character warning
The head ref may contain hidden characters: "react-\uae40\ud0dc\ud64d-sprint5"
Merged
Conversation
wseungjin
approved these changes
Jun 3, 2025
|
|
||
| function BestProductList() { | ||
| const pageSize = usePageSize(4, 2, 1); | ||
| const [bestList, setBestList] = useState([]); |
Collaborator
There was a problem hiding this comment.
이거 아예 훅으로 빼보면 어떨까요? 데이터 로직이랑 전부요
| import { usePageSize } from "./hooks/usePageSize"; | ||
|
|
||
| function BestProductList() { | ||
| const pageSize = usePageSize(4, 2, 1); |
Collaborator
There was a problem hiding this comment.
이거 객체로 받으면 4,2,1이 더 이해가 쉬울꺼 같아요
| const bestItems = (res.list || []) | ||
| .slice() | ||
| .sort((a, b) => b.favoriteCount - a.favoriteCount) | ||
| .slice(0, pageSize); |
| setPage, | ||
| handleSearch, | ||
| handleSortChange, | ||
| } = useProductList(pageSize); |
| totalCount, | ||
| pageSize, | ||
| siblingCount: 2, | ||
| }); |
| setPageSize(getPageSize()); | ||
| }; | ||
| window.addEventListener("resize", handleResize); | ||
| return () => window.removeEventListener("resize", handleResize); |
Collaborator
There was a problem hiding this comment.
screenSize를 enum으로 정의해보는것도 좋을꺼 같네요
| setAllItems(res.list || []); | ||
| }; | ||
| productData(); | ||
| }, []); |
Collaborator
There was a problem hiding this comment.
데이터 fetch쪽은 따로 더 뺴도 좋을꺼 같아요
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
요구사항
기본 요구사항
공통
중고마켓 페이지
심화 요구사항
공통
중고마켓 페이지