Skip to content
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

[임찬빈] sprint5 #135

Conversation

Bin000927
Copy link
Collaborator

@Bin000927 Bin000927 commented Mar 9, 2025

요구사항

기본 요구사항

공통

  • 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값을 적절하게 설정합니다.

주요 변경사항

베스트상품과 판매 중인 상품이 보이는 페이지.

스크린샷

image

멘토에게

  • 과제를 다 완성하지 못했습니다.. 그리고 자바스크립트와 리액트, api 셋 다 너무 어렵고 이해가 잘 안 가고 복잡하다는 생각이 들어서 더 못 한 것 같습니다 챗지피티도 사용했습니다 죄송합니다
  • PC, Tablet, Mobile 디자인에 해당하는 중고마켓 페이지를 만들어 주세요. 이 부분도 잘 몰라서 구현을 못 했습니다
  • api를 사용해서 상품들을 불러오긴 했으나 정렬과 페이지 이동기능, 검색 등 구현을 못했습니다.

@Bin000927 Bin000927 requested a review from coldplay126 March 9, 2025 14:54
@Bin000927 Bin000927 self-assigned this Mar 9, 2025
@Bin000927 Bin000927 changed the title React 임찬빈 sprint5 [임찬빈] sprint5 Mar 9, 2025
Copy link
Collaborator

@coldplay126 coldplay126 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

요구사항을 충족하느라 고생 많으셨습니다!

  • 레이아웃의 경우 다 잘 작성하셨는데 미디어 쿼리만 잘 적용하시면 충분히 하실 수 있을 것 같습니다!
  • 페이지네이선 부분은 컴포넌트로 분리하는 것도 잘 고려해 보시면 좋을 것 같아요!
  • chatGPT 사용 문제 없습니다! 잘 쓰는 법을 익히시면 러닝커브를 올리는데 큰 도움이 됩니다!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

리액트 프로젝트 root(최상위)에 위치하는게 좋습니다! panda market 폴더 하위가 아닌 6-sprint-mission-fe하위로 이동시켜 보시는건 어떨까요?

Comment on lines +7 to +8
<div className="navAll">
<div className="nav-left">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

클래스 네이밍 컨벤션 통일시켜 주시면 좋을 것 같습니다!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

요구사항은 잘 작성되어 있으니 미디어 쿼리 적용만 적용하면 사이즈별 레이아웃 처리를 할 수 있을 것 같습니다!

/* 예시 */

/* 태블릿 뷰 (1024px 이하) */
@media (max-width: 1024px) {
  .best-products {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .best-card, .best-card img {
    width: 100%;
    height: auto;
  }
  
  .product-card, .product-card img {
    width: 100%;
    height: auto;
  }
  
  .product-card img {
    aspect-ratio: 1/1;
  }
}

);
};

export default ProductsPage;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

전반적으로 잘 구현해 주셨지만 다음에는 컴포넌트를 기능별로 조금 더 잘게 나누어 보시면 어떨까요?

// 예시
// ProductCard.jsx 분리
const ProductCard = ({ product, isBest }) => (
  <div className={`product-card ${isBest ? 'best-card' : ''}`}>
    {product.images?.length > 0 && (
      <img src={product.images[0]} alt={product.name} />
    )}
    <div className="product-info">
      <h3>{product.name}</h3>
      <p className="product-price">{product.price}원</p>
      <div className="product-likes">♡ {product.likes}</div>
    </div>
  </div>
);

const [page, setPage] = useState(1);
const [sort, setSort] = useState("createdAt");
const [search, setSearch] = useState("");
const [loading, setLoading] = useState(false);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

load이 설정되어 있으나 유저에게 직접 노출되는 부분은 없는 것 같습니다. 아래 예시처럼 로딩 화면을 노출해 보시는건 어떨까요?

{loading ? (
  <div className="loading-spinner">로딩 중...</div>
) : (
  <div className="product-grid">
    {products.map((product) => (
      <ProductCard key={product.id} product={product} />
    ))}
  </div>
)}

@coldplay126 coldplay126 merged commit 13d2ebb into codeit-sprint-fullstack:react-임찬빈 Mar 12, 2025
1 check passed
@coldplay126
Copy link
Collaborator

그리고 PR 내용에 작업 후 작업 내용을 확인할 수 있는 URL 을 첨부해 주시면 더욱 좋을 것 같습니다!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants