[정우진] sprint 5#52
Merged
wseungjin merged 6 commits intocodeit-sprint-fullstack:basic-정우진from Jun 3, 2025
Hidden character warning
The head ref may contain hidden characters: "basic-\uc815\uc6b0\uc9c4-sprint1"
Merged
Conversation
wseungjin
approved these changes
Jun 3, 2025
| const width = useWindowWidth(); | ||
|
|
||
| const getVisibleCount = () => { | ||
| if (width <= 768) return 1; // Mobile |
Collaborator
There was a problem hiding this comment.
screenSize enum으로 mobile인걸 관리해주면 어떨까요?
| }; | ||
| fetchBestProducts(); | ||
| }, []); | ||
| const visibleBestProducts = products.slice(0, getVisibleCount()); |
| setLoading(false); | ||
| } | ||
| }; | ||
| fetchBestProducts(); |
Collaborator
There was a problem hiding this comment.
아예 데이터 자체를 custom hook로 빼는것도 좋아 보입니다~
| if (page < totalPages) { | ||
| onPageChange(page + 1); | ||
| } | ||
| }; |
Collaborator
There was a problem hiding this comment.
페이지네이션 관련 로직을 커스텀 훅으로 빼도 좋을꺼 같네요 ㅎㅎ
| import styles from "./productModal.module.css"; | ||
| import { useEffect } from "react"; | ||
|
|
||
| const ProductModal = ({ isOpen, onRequestClose, product }) => { |
Collaborator
There was a problem hiding this comment.
https://react.dev/reference/react-dom/createPortal
포탈로 모달을 만들어 보는건 어떨까요?
| // src/hooks/useWindowWidth.js | ||
| import { useState, useEffect } from "react"; | ||
|
|
||
| const useWindowWidth = () => { |
| favorite: "좋아요순", | ||
| }; | ||
|
|
||
| const MarketPage = () => { |
Collaborator
There was a problem hiding this comment.
이 컴포넌트가 너무 큰거 같아요 좀 로직별로 묶는 커스텀 훅을 구현하면 좋을꺼 같아요
| page = 1, | ||
| pageSize = 10, | ||
| keyword = "", | ||
| orderBy = "recent" |
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.
요구사항
기본
공통
[ ] Github에 스프린트 미션 PR을 만들어 주세요.
[ ] React를 사용해 진행합니다.
중고마켓 페이지
[ ] PC, Tablet, Mobile 디자인에 해당하는 중고마켓 페이지를 만들어 주세요.
[ ] 중고마켓 페이지 url path는 별도로 설정하지 않고, '/'에 보이도록 합니다.
[ ] 상단 네비게이션 바, 푸터는 랜딩 페이지와 동일한 스타일과 규칙으로 만들어주세요.
[ ] 상품 데이터는 https://panda-market-api.vercel.app/docs/에 명세된 GET 메소드 "/products" 를 활용해주세요.
[ ] 상품 목록 페이지네이션 기능을 구현합니다.
[ ] 드롭 다운으로 "최신 순" 또는 "좋아요 순"을 선택해서 정렬을 구현하세요.
[ ] 상품 목록 검색 기능을 구현합니다.
[ ] 베스트 상품 데이터는 https://panda-market-api.vercel.app/docs/에 명세된 GET 메소드 "/products"의 정렬 기준 favorite을 사용해주세요.
심화
공통
[ ] 커스텀 hook을 만들어 필요한 곳에 활용해 보세요.
중고마켓 페이지
[ ] 중고 마켓의 카드 컴포넌트 반응형 기준은 다음과 같습니다.
베스트 상품
Desktop : 4열
Tablet : 2열
Mobile : 1열
전체 상품
Desktop : 5열
Tablet : 3열
Mobile : 2열
반응형에 따른 페이지 네이션 기능을 구현합니다.
반응형으로 보여지는 물품들의 개수를 다르게 설정할때 서버에 보내는 pageSize값을 적절하게 설정합니다.
주요 변경사항
스크린샷
최신순

좋아요순

태블릿

모바일

'판다' 검색

검색결과 없을때

skeleton

유효하지 않은 이미지 url 로 인한 엑박 placeholder처리

이미지클릭시 미리보기모달

상세페이지는 /product/id로 페이지 구성할 예정입니다
멘토에게