Skip to content

Conversation

ToKyun02
Copy link
Collaborator

요구사항

기본

중고 마켓

  • 상품 등록하기 버튼을 누르면 "/additem" 로 이동합니다.
  • 각 상품 클릭 시 상품 상세 페이지로 이동합니다.
  • 상품 상세 페이지 주소는 "/items/{productId}" 입니다.

상품 상세

  • 내가 등록한 상품일 경우 상품 수정, 삭제가 가능합니다.
  • 문의하기 input창에 값을 입력 후 '등록' 버튼을 누르면 댓글이 등록됩니다.
  • 내가 등록한 댓글은 수정, 삭제가 가능합니다.

상품 등록

  • 이미지를 제외하고 input 에 모든 값을 입력하면 '등록' 버튼이 활성화 됩니다.
  • 활성화된 '등록' 버튼을 누르면 상품 등록이 완료됩니다.
  • 등록이 완료되면 해당 상품 상세 페이지로 이동합니다.

심화

  • API 요청에 TanStack React Query를 활용해주세요

주요 변경사항

  • /items 페이지에 ISR로 베스트 상품 목록 렌더링하였습니다.

멘토에게

  • 시간 관계 상 대부분의 요구사항은 구현하지 못했습니다.

@ToKyun02 ToKyun02 requested a review from Lanace February 28, 2025 03:29
@ToKyun02 ToKyun02 self-assigned this Feb 28, 2025
@ToKyun02 ToKyun02 changed the title ✨ feat : 베스트 상품 리스트 [김도균] Sprint12 Feb 28, 2025
Copy link
Collaborator

@Lanace Lanace left a comment

Choose a reason for hiding this comment

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

작업하시느라 고생 많으셨습니다!!ㅎㅎ

<ItemCard
key={item.id}
item={{ ...item, imageUrl: item.images[0] }}
className='w-[282px] object-cover h-[282px]'
Copy link
Collaborator

Choose a reason for hiding this comment

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

약간 고정값들이 너무 많이 나오는것같아요
보통 magic number라고 하는데, 가급적이면 이런건 따로 상수로 뽑아서 만들어두시는게 좋아요ㅎㅎ!

https://jake-seo-dev.tistory.com/155

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

매직넘버를 줄이는 게 좋다고 생각합니다! 좋은 의견 감사합니다.

Comment on lines +27 to +28
${index === 2 ? 'hidden md:flex' : ''}
${index === 3 ? 'hidden lg:flex' : ''} `}
Copy link
Collaborator

Choose a reason for hiding this comment

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

요런것도 일종의 매직넘버에요ㅎㅎ


export default function ItemCard({ item, className, display }: ItmeCardProps) {
return (
<div className={`flex flex-col gap-4 ${display}`}>
Copy link
Collaborator

Choose a reason for hiding this comment

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

display 만 따로 props로 받는것보단 차라리 className 을 받도록 처리하는건 어떨까요?ㅎ

추후 확장성을 위해서요~!!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

className으로 일괄 처리해주는 방식이 더 깔끔해 보입니다, 참고하겠습니다!

description: string;
price: number;
tags: string[];
images: string | null[];
Copy link
Collaborator

Choose a reason for hiding this comment

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

앗앗... 이거 괄호가 없으면 string 또는 null[] 이 타입으로 정의될꺼에요

그래서 (string | null)[] 로 해야할꺼에요ㅎㅎ~

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

헉... 깜빡했습니다. 좋은 지적 감사합니다.

@Lanace Lanace merged commit 9aaea31 into codeit-bootcamp-frontend:Next-김도균 Mar 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants