Skip to content

Conversation

@Moon-ju-young
Copy link
Collaborator

요구사항

기본

중고마켓

  • 중고마켓 페이지 주소는 “/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개 보이기

심화

  • 페이지 네이션 기능을 구현합니다.

주요 변경사항

스크린샷

image
image
image

멘토에게

  • 추가적인 질문이 있다면 셀프 코드 리뷰로 남기겠습니다.

@Moon-ju-young Moon-ju-young added the 매운맛🔥 뒤는 없습니다. 그냥 필터 없이 말해주세요. 책임은 제가 집니다. label May 6, 2025
Copy link
Collaborator

@GANGYIKIM GANGYIKIM left a comment

Choose a reason for hiding this comment

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

주영님 5번째 미션 제출 고생하셨습니다!
기존에 하신 주차들도 react로 옮겨주시느라 더 오래걸리셨을 것 같아요.
추후 시간이 되시면 react 방식으로 더 수정해주시면 학습에 도움이 되실거에요~
다음 미션도 화이팅입니다!

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.

💬 여담
React Router를 사용하고 계신데 향후 라우트가 많아지면 Route들을 별도의 파일로 분리하면 App 컴포넌트가 더 깔끔해지고, 라우트 관리도 쉬워집니다.

https://reactrouter.com/start/data/routing

import './Index.css';

function Index() {
document.title = "판다마켓";
Copy link
Collaborator

Choose a reason for hiding this comment

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

❗️ 수정요청
index.html에서 title 태그로 판다마켓을 설정해주셨기 때문에 필요없는 코드입니다~

Suggested change
document.title = "판다마켓";

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

다른 페이지에서 다시 index 페이지로 돌아올 경우 title이 판다마켓으로 돌아오지 않아서 필요했던 코드였습니다!

import Pagenation from '../components/Pagenation';

function Items() {
document.title = "중고마켓";
Copy link
Collaborator

Choose a reason for hiding this comment

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

❗️ 수정요청
사용하시는 라우트 라이브러리에서 메타태그를 정의하는 방법을 제공하니 아래의 문서를 읽고 변경하시는 것을 추천드립니다~

https://reactrouter.com/api/components/Meta

Comment on lines +23 to +25
<button
onClick={() => setPage( Math.ceil(page/5) === 1 ? 1 : Math.ceil(page/5 - 1)*5 )}
>
Copy link
Collaborator

Choose a reason for hiding this comment

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

💊 제안
캐러셀과 페이지네이션과 같은 컴포넌트의 경우 prevButton, nextButton 이 특정 조건에서는 disabled 되는 것이 일반적입니다.
이를 추가해보시면 더 좋을 것 같아요.

Copy link
Collaborator

Choose a reason for hiding this comment

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

💊 제안
button type 이 reset이 아니라면 명시해주세요~

Suggested change
<button
onClick={() => setPage( Math.ceil(page/5) === 1 ? 1 : Math.ceil(page/5 - 1)*5 )}
>
<button
type="button"
onClick={() => setPage( Math.ceil(page/5) === 1 ? 1 : Math.ceil(page/5 - 1)*5 )}
>

: <img src={icSort} /> }
{ isOpen &&
<ul className={styles.dropdownList}>
<li onClick={() => setState("recent")}>{option.recent}</li>
Copy link
Collaborator

Choose a reason for hiding this comment

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

❗️ 수정요청
이런 클릭 가능한 요소의 경우 버튼을 사용해주세요. 더 적절한 태그가 있는데 이미지 태그에 onClick 을 주게되면 button에게 기대하는 동작을 제대로 수행하지 못합니다!

Suggested change
<li onClick={() => setState("recent")}>{option.recent}</li>
<li>
<button type="button" value="recent" onClick={(e) => setState(e.target.value)}>{option.recent}</button>
</li>

위에처럼 button 태그로 바꾸시고 onClick 시 event 객체에서 button 태그의 value를 받아오는 방식으로 구현하시는 것을 추천드려요! 이렇게 하시면 option 객체를 기준으로 순회하셔서 작성하실수도 있습니다~

Copy link
Collaborator Author

@Moon-ju-young Moon-ju-young May 9, 2025

Choose a reason for hiding this comment

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

nested button 문제로 인해 <input type="button" />으로 구현하겠습니다!

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 Author

Choose a reason for hiding this comment

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

스프린트 미션5 요구사항에 검색 기능 구현은 없었던 것 같은데 혹시 제가 놓쳤나요?

@GANGYIKIM GANGYIKIM merged commit a29ab90 into codeit-bootcamp-frontend:React-문주영 May 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

매운맛🔥 뒤는 없습니다. 그냥 필터 없이 말해주세요. 책임은 제가 집니다.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants