Skip to content

[최지은] sprint5#93

Merged
ByungyeonKim merged 40 commits intocodeit-bootcamp-frontend:React-최지은from
Jiii-Eun:React-최지은
Aug 12, 2025

Hidden character warning

The head ref may contain hidden characters: "React-\ucd5c\uc9c0\uc740"
Merged

[최지은] sprint5#93
ByungyeonKim merged 40 commits intocodeit-bootcamp-frontend:React-최지은from
Jiii-Eun:React-최지은

Conversation

@Jiii-Eun
Copy link
Collaborator

@Jiii-Eun Jiii-Eun commented Aug 11, 2025

요구사항

  • Github에 PR(Pull Request)을 만들어서 미션을 제출합니다.
  • 피그마 디자인에 맞게 페이지를 만들어 주세요.
  • React를 사용합니다

기본

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

멘토에게

  • 하트를 눌렀을 때 favoriteCount를 patch를 하려했는데401 오류메시지가 나옵니다. 여기서 어떤 인증이 필요한지, 어떻게 해결해야할지 감이 오지 않아서 여쭤봅니다..

withyj-codeit and others added 30 commits September 3, 2023 21:56
[Fix] delete merged branch github action
- form내의 id/for 설정과 submit을 버튼으로 수정
@Jiii-Eun Jiii-Eun self-assigned this Aug 11, 2025
@Jiii-Eun Jiii-Eun marked this pull request as draft August 11, 2025 05:53
@Jiii-Eun Jiii-Eun requested a review from ByungyeonKim August 11, 2025 05:53
@Jiii-Eun Jiii-Eun added the 매운맛🔥 뒤는 없습니다. 그냥 필터 없이 말해주세요. 책임은 제가 집니다. label Aug 11, 2025
@Jiii-Eun Jiii-Eun removed the request for review from ByungyeonKim August 11, 2025 05:54
@Jiii-Eun Jiii-Eun marked this pull request as ready for review August 11, 2025 05:54
@Jiii-Eun Jiii-Eun requested a review from ByungyeonKim August 11, 2025 05:56
Copy link
Collaborator

@ByungyeonKim ByungyeonKim left a comment

Choose a reason for hiding this comment

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

안녕하세요, 지은님!
리액트로 넘어오면서 어려운 점들이 많으셨을텐데 고생 많으셨어요.

전반적으로 React의 기본기를 잘 다지고 계신 것 같아요. 다만, 이전 미션에서 사용한 파일과 샘플 폴더가 포함되어 있어요. 이런 부분은 따로 보관을 하고, 해당 브랜치에는 관련된 파일들만 관리 부탁드려요!

그리고 헤딩 태그의 계층 구조가 명확하지 않아요. 어떤 페이지는 h3 태그만 있고, h4만 있는 곳도 있어요. 각 헤딩 태그는 스타일을 위해 사용하기 보다는 목적에 맞게 사용해주세요. 😊

말씀하신 좋아요 기능은 현재 미션의 요구사항은 아니지만, 구현을 해보고 싶으시다면 로그인(인증) 기능부터 구현을 해야해요. 401 상태 코드는 "Unauthorized(권한 없음)"을 의미하죠. 인증 후에 응답으로 받은 accessToken을 좋아요 요청 헤더에 포함시키면 됩니다.

참고로, 403(Forbidden)은 인증은 되었지만 접근 권한이 부족한 경우를 뜻합니다. 🤓

Swagger를 통해 테스트 하는 방법을 알려드릴게요.

  1. Auth 섹션에서 /auth/signIn 클릭
  2. Try it out을 클릭
스크린샷 2025-08-12 오전 1 32 10 3. 그대로 Execute를 클릭하면 응답 바디에 있는 accessToken 복사 스크린샷 2025-08-12 오전 1 33 49 4. Authorize 버튼 클릭 후 Value 필드에 복사한 accessToken 붙여넣기 스크린샷 2025-08-12 오전 1 37 12

이후 Swagger에서 /products/{productId}/favorite 요청을 해보시면, 정상 동작하는 것을 확인하실 수 있어요. 👍

좋습니다! 이제 자세한 피드백은 아래에서 확인해 주세요. 하나씩 적용해 보시고, 궁금한 게 생기면 편하게 말씀해 주세요. 😀

Copy link
Collaborator

Choose a reason for hiding this comment

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

node_modules 폴더는 원격 저장소에 올리지 않는 걸까요? 저는 용량 문제불필요한 변경 추적이 가장 큰 이유라고 생각해요. node_modules는 패키지 매니저(npm, yarn, pnpm 등)가 package.jsonpackage-lock.json(yarn.lock)을 기반으로 언제든 내 컴퓨터에서 재생성할 수 있는 폴더예요.

기술 과제를 볼 때도 node_modules 폴더는 꼭 제외한 후 제출하라고 주의를 주기도 하죠. 이 점 유의해 주세요! 🙂

Copy link
Collaborator

Choose a reason for hiding this comment

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

피그마에서 이미지를 추출할 때는 원본 크기의 2~3배 크기로 다운 받는 게 좋아요. PC 화면일 때 이미지의 고유 크기보다 더 크게 렌더링 되고 있어서 선명하지 않는 느낌을 받아, 사용자에게 전문적이지 않은 인상을 줄 수 있어요.

이미지가 너무 커서 디바이스 크기별 이미지 최적화를 하고 싶다면, img 태그의 srcset, sizes 속성을 한번 찾아보세요. 👍

Copy link
Collaborator

Choose a reason for hiding this comment

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

아이콘 이미지들은 svg 파일로 다운받는 건 어떨까요? svg 파일은 이미지의 크기에 상관없이 항상 선명하다는 장점이 있어요. 다만, 모든 곳에 사용하기에는 용량이 비교적 높은 편이라 이런 간단한 아이콘에 사용하기 좋아요.

Copy link
Collaborator

Choose a reason for hiding this comment

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

"commom"으로 오타가 있네요! 🙂

@@ -0,0 +1,21 @@
import { Link } from "react-router-dom";

import IntroImage from "@/assets/img_home_top.png";
Copy link
Collaborator

Choose a reason for hiding this comment

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

파일명은 Img_home_top.png인데 img_home_top.png으로 import 해오고 있어요. 환경에 따라 이미지가 깨질 수 있어서 대소문자 구분을 명확하게 해야해요.

Comment on lines +86 to +95
useEffect(() => {
fetchProducts();
fetchBestProducts();
}, []);

// 페이지이동, 검색, 정렬변경, 화면 크기 변경했을 때 렌더링
useEffect(() => {
fetchProducts();
fetchBestProducts();
}, [page, searchInput, orderBy, device]);
Copy link
Collaborator

Choose a reason for hiding this comment

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

useEffect에 의존성을 추가하더라도, 첫 렌더링 시 실행을 합니다. 따라서 현재 코드는 중복 코드예요. 2번 요청을 4번 요청하게 되는거죠. 🤓

Suggested change
useEffect(() => {
fetchProducts();
fetchBestProducts();
}, []);
// 페이지이동, 검색, 정렬변경, 화면 크기 변경했을 때 렌더링
useEffect(() => {
fetchProducts();
fetchBestProducts();
}, [page, searchInput, orderBy, device]);
useEffect(() => {
fetchProducts();
fetchBestProducts();
}, [page, searchInput, orderBy, device]);

Comment on lines +10 to +16
const totalPages = Math.ceil(totalCount / getAllList());

const groupStart = Math.floor((page - 1) / PAGE_GROUP) * PAGE_GROUP + 1;
const groupEnd = Math.min(groupStart + PAGE_GROUP - 1, totalPages);

const prevGroup = groupStart > 1;
const nextGroup = groupEnd < totalPages;
Copy link
Collaborator

Choose a reason for hiding this comment

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

렌더링 중에 계산 가능한 값은 상태가 아닌 변수로 선언한 점이 좋네요. 👍

<div className={`listBox ${isOpen ? "open" : ""}`}>
<div className="listLabel" onClick={() => setIsOpen((prev) => !prev)}>
<span>{orderBy === "recent" ? "최신순" : "인기순"}</span>
<img className="arrow_icon" src={arrowIcon} alt="arrowIcon" />
Copy link
Collaborator

Choose a reason for hiding this comment

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

접근성 개선을 해볼까요? 스크린 리더가 해당 이미지를 읽을 때, "화살표 아이콘"이라고 읽기 보다는 "정렬 옵션 토글 아이콘"으로 읽게 만드는 건 어떨까요? 참고로, 스크린 리더는 마지막에 "이미지"를 추가로 말해줍니다. (e.g. arrowIcon 이미지)

Copy link
Collaborator

Choose a reason for hiding this comment

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

HomeFooter에서 불러오는 snsData를 별도의 컴포넌트로 분리해 내부에서 관리하는 건 어떨까요? sns_wrapper 전용 컴포넌트를 만들면, UI 컴포넌트가 더 명확해지고 SNS 영역을 재사용하거나 유지보수하기도 더 쉬워집니다.

Comment on lines +32 to +35
<Route element={<NoLayout />}>
<Route path="/login" element={<LoginPage />} />
<Route path="/signup" element={<SignupPage />} />
</Route>
Copy link
Collaborator

@ByungyeonKim ByungyeonKim Aug 11, 2025

Choose a reason for hiding this comment

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

레이아웃이 필요하지 않다면 Route로 감쌀 필요는 없습니다. 불필요한 컴포넌트 계층은 지양하는 것이 좋아요. 🙂

Comment on lines +65 to +69
.nav_group a.active {
text-decoration: underline;
text-underline-offset: 4px;
text-decoration-thickness: 2px;
}
Copy link
Collaborator

@ByungyeonKim ByungyeonKim Aug 11, 2025

Choose a reason for hiding this comment

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

페이지 주소가 "/items" 일때 상단 네비게이션바의 "중고마켓" 버튼의 색상을 요구사항에서 제시한 색상으로 변경해 주세요. 😊

@ByungyeonKim ByungyeonKim merged commit eff3d9b into codeit-bootcamp-frontend:React-최지은 Aug 12, 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.

5 participants

Comments