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 #114

Merged

Conversation

gksktl111
Copy link
Collaborator

@gksktl111 gksktl111 commented Mar 2, 2025

기본 요구사항

공통

  • Github에 스프린트 미션 PR을 만들어 주세요.
  • React를 사용해 진행합니다.

중고마켓 페이지

  • PC, Tablet, Mobile 디자인에 해당하는 중고마켓 페이지를 만들어 주세요.
  • 중고마켓 페이지 url path는 별도로 설정하지 않고, '/'에 보이도록 합니다.
  • 상단 네비게이션 바, 푸터는 랜딩 페이지와 동일한 스타일과 규칙으로 만들어주세요.
  • 상품 데이터는 Panda Market API에 명세된 GET 메소드 "/products" 를 활용해주세요.
  • 상품 목록 페이지네이션 기능을 구현합니다.
  • 드롭 다운으로 "최신 순" 또는 "좋아요 순"을 선택해서 정렬을 구현하세요.
  • 상품 목록 검색 기능을 구현합니다.
  • 베스트 상품 데이터는 Panda Market API에 명세된 GET 메소드 "/products"의 정렬 기준 favorite을 사용해주세요.

심화 요구사항

공통

  • 커스텀 hook을 만들어 필요한 곳에 활용해 보세요.

중고마켓 페이지

  • 중고 마켓의 카드 컴포넌트 반응형 기준은 다음과 같습니다.
    • 베스트 상품
      • Desktop : 4열
      • Tablet : 2열
      • Mobile : 1열
    • 전체 상품
      • Desktop : 5열
      • Tablet : 3열
      • Mobile : 2열
  • 반응형에 따른 페이지 네이션 기능을 구현합니다.
  • 반응형으로 보여지는 물품들의 개수를 다르게 설정할 때 서버에 보내는 pageSize 값을 적절하게 설정합니다.

배포 사이트

멘토에게

  • 폴더 구조를 FSD를 사용했습니다. readme 파일을 읽어주시면 감사하겠습니다.

@gksktl111 gksktl111 self-assigned this Mar 2, 2025
{ allowConstantExport: true },
],
// js 문법에서는 prop-types를 사용하지 않기에 비활성화함
'react/prop-types': 'off',
Copy link
Collaborator

Choose a reason for hiding this comment

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

'react/prop-types': 'off' 옵션은 js 문법에서 비활성화 하는 것이 아니라 prop-types 를 js 환경에서 쓰지 않는 경우에 비활성화 하는 것입니다.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

앗 수정하겠습니다

return { windowWidth, isMobile, isTablet };
};

export default useDeviceType;
Copy link
Collaborator

Choose a reason for hiding this comment

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

구조가 깔끔해요! 나중에 context 확장하기도 좋을 것 같아 보입니다:)

Copy link
Collaborator

@loquemedalagana loquemedalagana left a comment

Choose a reason for hiding this comment

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

UI 관련 컴포넌트들이나 페이지를 구성하는 조각으로 이루어진 컴포넌트들은 page 내에 두신 이유가있을까요?

# 폴더 구조 소개

- 우선 FSD 아키텍쳐의 숙련도가 낮은 관계로 app, pages, shared 3 개의 폴더로만 구성했습니다. (만약 공통 요소가 안나올시 shared는 폐기될 수 있습니다.)
- FSD 아키텍쳐는 폴더의 이름에 제한이 없으나 우선 공식문서에 있는 이름 규칙을 준수했습니다.
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

@gksktl111 gksktl111 Mar 11, 2025

Choose a reason for hiding this comment

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

"UI 관련 컴포넌트들이나 페이지를 구성하는 조각으로 이루어진 컴포넌트들은 page 내에 두신 이유가있을까요?"

위 코멘트에 답글이 안달려서 여기에 달겠습니다.

해당 컴포넌트들은 관련 page에서만 재사용되는 컴포넌트들이라 그렇습니다. 만약 좀 더 범용적으로 사용되는 컴포넌트라면 shared의 component 폴더로 이동할 것 입니다.

Copy link
Collaborator Author

@gksktl111 gksktl111 Mar 11, 2025

Choose a reason for hiding this comment

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

조금 더 추가적으로 설명하자면 현재 "세그먼트"(3단계 deps) 단에 있는 3개의 폴더 "api", "model", "ui"에 대해 짧게 설명하자면

api 폴더는 말그대로 api 통신에 관련된 로직만,
model 폴더는 api 통신을 통해 받아온 데이터의 가공 및 UI를,
ui 폴더는 그냥 렌더링을 담당하는

폴더로 구성하였습니다.

Copy link
Collaborator

Choose a reason for hiding this comment

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

좋습니다! 그러면 본격적인 아키텍처 구성은 곧 진행하는 팀 프로젝트에서 제대로 배워보는걸로 해요~

</footer>
);
};

Copy link
Collaborator

Choose a reason for hiding this comment

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

footer는 이렇게 짜시는게 맞습니다!

import twitter from '../../../../public/img/ic_twitter.png';
import youtube from '../../../../public/img/ic_youtube.png';
import instagram from '../../../../public/img/ic_instagram.png';

Copy link
Collaborator

Choose a reason for hiding this comment

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

절대경로 vs 상대경로 찾아보세요! 설정 파일은 jsconfig 혹은 타입스크립트 사용 시 tsconfig 입니다.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

찾아보고 수정하겠습니다!

@loquemedalagana
Copy link
Collaborator

스크린샷 2025-03-11 오후 5 30 28

# 폴더 구조 소개

- 우선 FSD 아키텍쳐의 숙련도가 낮은 관계로 app, pages, shared 3 개의 폴더로만 구성했습니다. (만약 공통 요소가 안나올시 shared는 폐기될 수 있습니다.)
- FSD 아키텍쳐는 폴더의 이름에 제한이 없으나 우선 공식문서에 있는 이름 규칙을 준수했습니다.
Copy link
Collaborator

Choose a reason for hiding this comment

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

좋습니다! 그러면 본격적인 아키텍처 구성은 곧 진행하는 팀 프로젝트에서 제대로 배워보는걸로 해요~

const [isOpen, setIsOpen] = useState(false);
const [order, setOrder] = useState(ORDER_LIST[0]);
const [totalPage, setTotalPage] = useState(0);
const [currentPage, setCurrentPage] = useState(1);
Copy link
Collaborator

Choose a reason for hiding this comment

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

pagination을 custom hook으로 빼보시는 방법을 한번 고민해보세요~

import styles from './Pagination.module.css';
import { IoIosArrowBack, IoIosArrowForward } from 'react-icons/io';

const Pagination = ({ totalPage, currentPage, setCurrentPage }) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

pagination이 hook으로 사용되면 이 파일도 같이 통합하셔야해요!!

}) => {
function formatNumberWithComma(number) {
return number.toLocaleString();
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

이거 잘 하셨어요! 별거 아닌거 같은데 은근 중요한 것입니다ㅠ

const Header = () => {
const location = useLocation();

const isCommunity = location.pathname === '/community';
Copy link
Collaborator

Choose a reason for hiding this comment

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

useRouter hook으로 따로 빼보시는 방법 생각해보세요~!

@loquemedalagana loquemedalagana merged commit 7ae58cb into codeit-sprint-fullstack:react-박민규 Mar 12, 2025
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.

3 participants