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

[장바구니 협업 Step 1] 헤다(윤다혜) 미션 제출합니다. #104

Merged
merged 22 commits into from
May 25, 2023

Conversation

Dahyeeee
Copy link

@Dahyeeee Dahyeeee commented May 25, 2023

브콜 안녕하세요! 레벨1때 만났었는 때 또 만났네요~~ 반갑습니다!!

이번 코드는 페어인 '타미'의 코드 베이스로 작성했고 백엔드와 서버 3개를 연결하는 작업을 했습니다.
서버에 따라 다른 data를 가져와서 보여줘야하는 과정이 생각보다 까다로워서 아직 버그가 몇가지 있기도 합니다 ㅠㅠ
앞으로 고쳐나가도록 하겠습니다!!

백엔드랑 통신하니 너무 재밌고 즐거웠습니다 ~

한가지 궁금한 점은 Suspense를 어떻게 사용해야하는지 모르겠습니다. data fetching을 하는 컴포넌트를 suspense로 감싸줬는데 원하는데로 동작을 하지 못해서 하나 더 나간 상위 컴포넌트를 감싸줬는데 그때서야 fallback 컴포넌트가 랜더링 됐습니다.
..왜그럴까요..? ㅎㅎ....

image
제가 원했던 건 여기서 <ProductItemList>를 Suspense로 감싸주는 거였는데 안됐습니다.

image

이렇게 감싸주니 되더라구요 ㅠ

레벨2 마지막 미션인데 잘 부탁드립니다 브콜!!

pocojang and others added 22 commits May 4, 2021 13:04
* chore: init project

* docs: 기능 목록 작성

* design: 전역 스타일링 적용

* feat: router 설정

* design: styles.d.ts 파일 생성

* feat: Svg 컴포넌트 생성

* feat: Header 컴포넌트 생성

* docs: 기능 목록 업데이트

Co-authored-by: 정호진 <hozzijeong@users.noreply.github.com>

* chore: storybook에 Global Style 적용

Co-authored-by: hozzijeong <ghwls0905@naver.com>

* feat: Counter 컴포넌트 생성

Co-authored-by: 정호진 <hozzijeong@users.noreply.github.com>

* chore: storybook에서 svg sprite를 사용할 수 있게 설정

Co-authored-by: hozzijeong <ghwls0905@naver.com>

* feat: CartItem 컴포넌트 구현

Co-authored-by: hozzijeong <ghwls0905@naver.com>

* feat: 상품 목록 목데이터 생성

Co-authored-by: hozzijeong <ghwls0905@naver.com>

* design: CartItem 디자인 수정

Co-authored-by: hozzijeong <ghwls0905@naver.com>

* feat: 상품 목록을 fetch해오는 로직 구현

Co-authored-by: hozzijeong <ghwls0905@naver.com>

* refactor: CartItem -> ProductItem으로 네이밍 변경

Co-authored-by: 정호진 <hozzijeong@users.noreply.github.com>

* feat: SVG 기본 props를 받아오게 설정

Co-authored-by: hozzijeong <ghwls0905@naver.com>

* feat: 장바구니 버튼을 눌렀을 때 수량 변경하는 기능 구현

Co-authored-by: hozzijeong <ghwls0905@naver.com>

* docs: 기능 목록 업데이트

Co-authored-by: hozzijeong <ghwls0905@naver.com>

* design: Counter 컴포넌트 디자인 수정

Co-authored-by: 정호진 <hozzijeong@users.noreply.github.com>

* refactor: add, remove하는 로직을 custom hook으로 분리

Co-authored-by: hozzijeong <ghwls0905@naver.com>

* refactor: 수량이 변경될 때 해당 컴포넌트만 렌더링 되게 atomFamily로 리팩토링

Co-authored-by: 정호진 <hozzijeong@users.noreply.github.com>

* design: 폰트 설정

Co-authored-by: 정호진 <hozzijeong@users.noreply.github.com>

* design: header 고정 및 스타일 변경

Co-authored-by: 정호진 <hozzijeong@users.noreply.github.com>

* feat: CartId, ProductId 타입 생성

Co-authored-by: hozzijeong <ghwls0905@naver.com>

* feat: 데이터 수정

Co-authored-by: hozzijeong <ghwls0905@naver.com>

* feat: error, success svg icon 추가

Co-authored-by: hozzijeong <ghwls0905@naver.com>

* refactor: 스토리북 분류 추가

Co-authored-by: hozzijeong <ghwls0905@naver.com>

* feat: Toast popup 컴포넌트 구현

Co-authored-by: hozzijeong <ghwls0905@naver.com>

* refactor: productId, cartId 타입 명시

Co-authored-by: hozzijeong <ghwls0905@naver.com>

* chore: build 설정

* chore: 스토리북 자동배포 설정

* docs: 기능 목록 업데이트

* feat: favicon 변경 및 title 수정

* design: 토스트 팝업이 사라지는 애니메이션 구현

* refactor: Counter 컴포넌트에 맞춰 add, remove를 increment, decrement로 네이밍 변경

* chore: 사용하지 않는 파일 삭제

* style: props를 DOM 요소로 인식하지 않게 변수 앞에  추가

* feat: Toast 컴포넌트를 렌더링 하는 custom hook 구현

* style: baseUrl을 src로 수정 및 코드 스타일 수정

* feat: BrowserRouter에서 createBrowserRouter로 변경

* feat: api Loading state 추가

* refactor: renderToast를 함수에서 JSXElement 형태로 변경

* design: 헤더와 ProductList 페이지에 반응형 구현

* feat: 로고를 클릭했을 때 상태가 초기화되도록 구현

* chore: tsconfig target을 ES2015->ES5로 수정

* feat: 로고 클릭 시 메인 페이지로 이동하는 기능 구현

* docs: update README.md

* feat: 토스트 메시지들이 겹치지 않게끔 ToastContainer 생성

* fix: fix typo

* fix: 요구사항에 맞춰 물품 개수->품목 개수로 수정

---------

Co-authored-by: 정호진 <hozzijeong@users.noreply.github.com>
Co-authored-by: hozzijeong <ghwls0905@naver.com>
* docs: 2단계 기능 목록 업데이트

* move: Counter 컴포넌트를 common 디렉토리로 이동

* feat: Toast 컴포넌트에 createPortal 적용

* feat: ProductItem 스켈레톤 컴포넌트 구현

* chore: msw 설치

* feat: msw로 API 모킹

* chore: 배포 브랜치 추가

* fix: 배포 환경 수정

* design: theme에 색상 추가 및 폰트 네이밍 변경

* feat: 휴지통 svg 아이콘 추가

* feat: CartItem 컴포넌트 생성

* feat: post요청을 할 수 있도록 useFetch 훅 변경

* refactor: useProductSelect export 방식 변경

* fix: CartItem 컴포넌트 props 수정

* feat: 결제 예상 금액을 알려주는 PaymentDetail 컴포넌트 구현

* feat: CartId와 ProductId 통일

* feat: 헤더에서 atom 전체를 reset하는 로직 제거

* feat: localStorage setItem, getItem을 할 수 있는 hook 생성

* feat: cartList를 localStorage에 저장하고 불러오는 기능 구현

* feat: useFetch hook에 patch request 함수 추가

* feat: ProductList 페이지에서 카운터를 눌렀을 때 변경된 수량에 대해 post, patch 요청 구현

* feat: CartList 페이지 마크업

* fix: CartItem의count props를 currentItem의 quantity로 수정

* feat: 카운터의 숫자가 최소값일 때 button disabled 속성 추가

* docs: 기능 목록 업데이트

* feat: useFetch hook에 delete request 함수 추가

* feat: 휴지통 아이콘을 클릭해 장바구니 아이템을 삭제하는 기능 구현

* fix: ProductItem의 카운터 min값을 0으로 변경

* refactor: cartId와 productId를 통일함에 따라 productId->cartId로 네이밍 변경

* docs: 완료된 기능 목록 업데이트

* feat: 체크박스가 선택된 아이템에 대해 상품 가격 계산 기능 구현

* feat: 장바구니 페이지에서 체크박스 기능 구현

* refactor: 장바구니 이동하는 부분을 버튼으로 변경

* design: 장바구니 헤더 스타일, 체크박스 색상 수정

* design: 모바일 환경 반응형 대응

* feat: 로딩 skeleton ui 적용

* docs: 기능 목록 업데이트

* feat: 장바구니가 비어있는 경우 대응

* chore: storybook의 RecoilRoot를 각 컴포넌트로 이동

* refactor: ProductItemList 컴포넌트로 상품 리스트 이동

* chore: storybook에 msw-addon 설치

* fix: 전체 삭제를 했을 때 undefined가 되는 문제 해결

* chore: RecoilRoot decorator을 다시 preview 파일로 롤백

* feat: CartItemList 컴포넌트 스토리북 작성

* feat: ProductItemList 컴포넌트 스토리북 작성

* move: 컴포넌트 디렉토리를 Common/Product/Cart로 분리

* refactor: useFetch hook을 useGet, useMutate로 분리

* feat: api request를 모아놓은 파일 생성

* refactor: 바뀐 hook 구조에 따라 fetch하는 로직 수정

* refactor: cartList를 atomFamily->atom으로 관리하도록 변경

* refactor: localStorage를 사용하는 로직을 hook->util로 변경

* design: 로고 아이콘에 cursor:pointer 속성 추가

* refactor: 인라인 함수로 있었던 함수를 onNavigateCart로 분리

* refactor: ContentLayout 컴포넌트에 Header 컴포넌트 추가

* refactor: totalPriceSelector 계산 로직 리팩토링

* refactor: 사용하지 않는 로직 제거

* refactor: 컴포넌트 리턴문이 모호하게 작성된 부분 리팩토링

* feat: 로딩 스피너 컴포넌트 구현

* feat: 장바구니 목록을 불러올 때 로딩 스피너 적용

* style: 사용하지 않는 코드 제거

* refactor: any 제거

* feat: 장바구니에 로딩 문구 추가

* refactor: checkedItems를 전역상태에서 제거

* feat: index.html에 메타태그 추가

* feat: github pages에서 새로고침 했을 때 404가 뜨는 현상 해결

* feat: 존재하지 않는 페이지로 라우팅시 404 페이지 노출

* feat: 상품을 선택 삭제할 때 모달 적용

* feat: checkedItems를 다시 전역상태로 롤백

* fix: CartItem 스토리북 수정

* fix: 장바구니가 비어있는 텍스트가 나오지 않는 경우 수정
Copy link

@Tanney-102 Tanney-102 left a comment

Choose a reason for hiding this comment

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

안녕하세요 헤다~
질문 주신 내용은 디깅해보고 원인을 알게되면 따로 연락드릴게요!
리뷰없이 머지 취지에 따라 당장 답변드리기 어려운 내용은 뒤로 미루는 것이니 양해부탁드립니다!

@Tanney-102 Tanney-102 merged commit eafd56f into woowacourse:dahyeeee May 25, 2023
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.

None yet

4 participants