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

[장바구니 협업 Step2] 도밥(이도현) 미션 제출합니다. #172

Merged
merged 151 commits into from
Jun 12, 2023
Merged
Show file tree
Hide file tree
Changes from 142 commits
Commits
Show all changes
151 commits
Select commit Hold shift + click to select a range
d599b54
refactor: 라우터 경로 관련 개선
Creative-Lee May 28, 2023
cba046c
refactor: 로컬스토리지 관련 로직 개선
Creative-Lee May 28, 2023
bcfa449
chore: 장바구니 아이콘 변경 및 로고 추가
Creative-Lee May 28, 2023
05e268d
chore: 주문목록 아이콘 추가
Creative-Lee May 28, 2023
58f9656
design(Header): 컴포넌트 디자인 개선
Creative-Lee May 28, 2023
bf60cf1
refactor: 헤더 컴포넌트 children props 삭제로 인한 수정
Creative-Lee May 28, 2023
433de15
design(SelectBox): 컴포넌트 디자인 추가
Creative-Lee May 28, 2023
447fded
design(Header): main logo 컨테이너 수정
Creative-Lee May 28, 2023
0439601
design: grayscale 팔레트 추가 및 팔레트 적용
Creative-Lee May 28, 2023
d42c133
feat(Box): 공통 스타일 컴포넌트 구현
Creative-Lee May 28, 2023
2e2a500
design(CartProductSection): 선택 삭제 버튼 디자인 개선
Creative-Lee May 29, 2023
1a86203
refactor: atom, selector 네이밍 개선
Creative-Lee May 29, 2023
9e60665
refactor: atom, selector 네이밍 개선
Creative-Lee May 29, 2023
ecd92df
refactor: 변수명 개선으로 인한 코드 수정
Creative-Lee May 29, 2023
bf5c99a
chore: 스토리북 msw 실행을 위한 패키지 설치 및 환경설정
Creative-Lee May 29, 2023
23c6da2
chore: .env gitignore 추가
Creative-Lee May 29, 2023
c577496
refactor: api baseUrl 정보 env 파일로 관리
Creative-Lee May 29, 2023
2a1121b
test: 스토리북 폰트 설정 및 서비스 워커 경로 설정
Creative-Lee May 29, 2023
371ba21
refactor(cart): msw 핸들러에 가변 baseUrl 적용
Creative-Lee May 29, 2023
a5d86d9
refactor: 파일명 변경 및 checked 상태의 상품 목록 파생상태 selector 추가
Creative-Lee May 29, 2023
93c4565
chore: 파일명 변경으로 인한 import 경로 수정
Creative-Lee May 29, 2023
6510228
test(OrderProductCard): 컴포넌트 스토리 추가
Creative-Lee May 29, 2023
c45c94e
feat(OrderProductCard): 컴포넌트 구현
Creative-Lee May 29, 2023
4129ecd
test(OrderProductCardList): 컴포넌트 스토리 추가
Creative-Lee May 29, 2023
fef361d
feat(OrderProductCardList): 컴포넌트 구현
Creative-Lee May 29, 2023
62f7b85
design(OrderProductCard): 컴포넌트 디자인 개선
Creative-Lee May 29, 2023
c5a5b2d
chore: 화살표 아이콘 추가
Creative-Lee May 30, 2023
bcf1674
refactor:(OrderProductCardList): 아코디언 적용
Creative-Lee May 30, 2023
8c7863a
test(OrderProductCardList): 스토리 레이아웃 추가
Creative-Lee May 30, 2023
ac85593
feat(Accordion): 아코디언 컴포넌트 구현
Creative-Lee May 30, 2023
265b185
refactor(OrderProductCardList): 아코디언 관련 로직 공용컴포넌트로 대체
Creative-Lee May 30, 2023
30d88dd
test(Accordion): 스토리 추가
Creative-Lee May 30, 2023
03f233e
design(OrderProductCardList): hover css 추가
Creative-Lee May 30, 2023
7a87ec3
docs: 기능 구현 목록 추가
Creative-Lee May 30, 2023
18344a0
design(OrderProductCardList): css 수정
Creative-Lee May 31, 2023
1e2db6e
test(OrderPointTab): 컴포넌트 스토리 추가
Creative-Lee May 31, 2023
c3e7b06
feat(OrderPointTab): 컴포넌트 구현
Creative-Lee May 31, 2023
85c4e9c
feat: 포인트 GET요청 msw 핸들러 추가
Creative-Lee May 31, 2023
20dcf83
feat: 포인트 GET 요청 로직 구현
Creative-Lee May 31, 2023
9a89ad8
refactor(handlers): msw 핸들러 index 파일 생성으로 import 경로 정리
Creative-Lee May 31, 2023
1037882
feat: 유저 사용예정 포인트 관련 컨택스트 생성
Creative-Lee May 31, 2023
f434e83
feat: 주문페이지 라우터 추가
Creative-Lee May 31, 2023
b66b2e5
feat(OrderProductSection): 컴포넌트 구현
Creative-Lee May 31, 2023
ec33a6b
docs: 기능 구현 목록 업데이트
Creative-Lee May 31, 2023
1db66d0
refactor: 서버 선택 기본값 헙크 로 변경
Creative-Lee May 31, 2023
b844625
feat(OrderPriceSection): 컴포넌트 구현
Creative-Lee May 31, 2023
deba0b6
feat(policy): 정책 관련 상수 분리
Creative-Lee May 31, 2023
5d5a0cb
feat(OrderPage): 주문페이지 구현
Creative-Lee May 31, 2023
3c46273
design: 레이아웃 css 수정
Creative-Lee May 31, 2023
4ad2ab5
refactor: 헤더 네비게이션 메뉴 라우트 변경
Creative-Lee Jun 1, 2023
77d1b63
feat(Router): 라우터 경로 추가
Creative-Lee Jun 1, 2023
d570f64
feat(routePath): 라우터 경로 상수 추가
Creative-Lee Jun 1, 2023
14e203d
refactor: 라우터 상수명 변경 및 컴포넌트 명 변경
Creative-Lee Jun 1, 2023
9f1f6e4
refactor: 장바구니 선택 상품만 거르는 selector 로직 개선
Creative-Lee Jun 1, 2023
9977794
feat: 주문목록 msw 핸들러 추가 및 적용
Creative-Lee Jun 1, 2023
cf39b54
refactor: orderList fixture 이미지 링크 추가
Creative-Lee Jun 1, 2023
a1b533b
feat(OrderCard): 컴포넌트 구현
Creative-Lee Jun 1, 2023
4f47560
feat(OrderCardList): 컴포넌트 구현
Creative-Lee Jun 1, 2023
3fc4709
feat: 주문 목록 GET 함수 구현
Creative-Lee Jun 1, 2023
b8e30a1
feat(OrderListPage): 페이지 컴포넌트 구현
Creative-Lee Jun 1, 2023
f460965
feat(order): 타입 추가
Creative-Lee Jun 1, 2023
b515e2c
design: 주문 상세 버튼 css 수정
Creative-Lee Jun 1, 2023
04dbdde
refactor(useFetch): 의존배열 수정
Creative-Lee Jun 1, 2023
40a7a52
feat: 특정 주문 GET 요청 함수 구현
Creative-Lee Jun 1, 2023
2676441
feat: 단일 주문 GET 요청 msw 핸들러 구현
Creative-Lee Jun 1, 2023
da88336
refactor(useFetch): 로딩 초기값 true로 변경
Creative-Lee Jun 1, 2023
117f0ad
refactor(OrderCard): isDetail 플래그 props 추가
Creative-Lee Jun 1, 2023
63a1085
feat(OrderDetailPage): 페이지 컴포넌트 구현
Creative-Lee Jun 1, 2023
52b718b
design: 필요없는 속성 삭제
Creative-Lee Jun 1, 2023
0e43092
feat: 주문 상세 페이지 라우터 추가
Creative-Lee Jun 1, 2023
cd532a4
chore: order -> checkout 으로 파일, 디렉터리, route path 총 수정
Creative-Lee Jun 1, 2023
3d286e9
chore: gitignore .env 추가
Creative-Lee Jun 2, 2023
e478efc
refactor: 인증 정보 환경변수로 관리
Creative-Lee Jun 2, 2023
d32c78d
refactor: 서버 에러 형식 수정
Creative-Lee Jun 2, 2023
85aa6ae
refactor: msw 인증 로직 개선
Creative-Lee Jun 2, 2023
4c9a617
feat(DetailPriceSection): 컴포넌트 구현
Creative-Lee Jun 2, 2023
8d459a2
design: css 수정
Creative-Lee Jun 2, 2023
778db39
feat: 주문 생성 함수 구현 및 컴포넌트 함수 바인딩
Creative-Lee Jun 2, 2023
6bfc57e
refactor: 금액 단위 추가
Creative-Lee Jun 2, 2023
28650d9
fix: 체크된 상품 selector 로직 관련 버그 수정
Creative-Lee Jun 2, 2023
c661020
refactor: 장바구니 데이터 초기화 관련 개선
Creative-Lee Jun 2, 2023
f32f88f
refactor: 불필요한 연산자 제거
Creative-Lee Jun 2, 2023
a6d12c2
refactor(CheckOutPriceSection): 금액 표시 분기 로직 추가 및 개선
Creative-Lee Jun 2, 2023
3d589be
fix: 상품가격을 넘어선 포인트 사용이 가능했던 버그 수정
Creative-Lee Jun 2, 2023
91d5549
refactor: 배송비 상수 적용
Creative-Lee Jun 2, 2023
759ec07
refactor(CheckOutPriceSection): 컴포넌트 text관련 ui 로직 hook 분리
Creative-Lee Jun 2, 2023
b5034b0
refactor(cartProductIdStoreState): 불필요한 atom 삭제
Creative-Lee Jun 3, 2023
bbe0a3a
refactor: 불필요한 selector 삭제 및 의도대로 동작하지 않는 resetRecoil 로직 삭제
Creative-Lee Jun 3, 2023
72ae21a
fix: 장바구니 atom 첫 기본 체크 이후 새상품 추가시 체크되지 않은 상태였던 버그 수정
Creative-Lee Jun 3, 2023
8d6682e
chore: 불필요한 import 제거
Creative-Lee Jun 3, 2023
20cc949
refactor(CheckOutPriceSection): 컴포넌트에서 custom hook 분리
Creative-Lee Jun 3, 2023
3d28e06
chore: api 함수 네이밍 개선
Creative-Lee Jun 3, 2023
b5814ba
refactor(cartProducts): 불필요한 selectorFamily를 selector로 변경
Creative-Lee Jun 3, 2023
c980d44
refactor(CartPriceSection): 장바구니 가격 text로직 hook 분리
Creative-Lee Jun 3, 2023
b1144fb
design: 가격표 디자인 통일
Creative-Lee Jun 3, 2023
780fd49
design: 장바구니 상품 관련 디자인 통일
Creative-Lee Jun 3, 2023
ad8200e
design: FlexBox 컴포넌트제거 및 Box컴포넌트로 모두 대체
Creative-Lee Jun 3, 2023
5c8b054
design: 페이지 제목 디자인 통일
Creative-Lee Jun 3, 2023
ac35162
refactor: delte API 명세 변경으로 인한 수정
Creative-Lee Jun 4, 2023
24404ab
refacotor: api 함수명 일관성 있게 개선
Creative-Lee Jun 4, 2023
ae0d531
refactor: 전역상태 setter 로직 일관성 개선
Creative-Lee Jun 4, 2023
3fe1069
refactor: 컴포넌트 return문 내의 계산로직 변수로 분리
Creative-Lee Jun 4, 2023
d40fb3d
refactor: 페이지 컴포넌트에서 컴포넌트 분리
Creative-Lee Jun 4, 2023
183c0b8
refactor(LoadingErrorCard): props 추가 및 사용처 적용
Creative-Lee Jun 4, 2023
aeaf7cb
refactor(OrderCardList): 로딩 에러 카드 적용
Creative-Lee Jun 4, 2023
d13c559
test(SelectBox): 스토리 추가
Creative-Lee Jun 4, 2023
201679e
test(CartPriceSection): 스토리 추가
Creative-Lee Jun 4, 2023
7a22fd5
test(CartProductSection): 스토리 추가
Creative-Lee Jun 4, 2023
131e546
test(CartProductCardList): 스토리 추가
Creative-Lee Jun 4, 2023
bf86f04
test(CartProductCard): 스토리 추가
Creative-Lee Jun 4, 2023
76e8336
test(CheckOutPriceSection): 스토리 추가
Creative-Lee Jun 4, 2023
ab81c6d
test(CheckOutProductSection): 스토리 추가
Creative-Lee Jun 4, 2023
52f8ea6
chore: 스토리북 기본 viewport 변경 및 msw 경로 설정
Creative-Lee Jun 4, 2023
050d2f2
refactor: msw 핸들러 개선 및 추가
Creative-Lee Jun 4, 2023
ceae9f8
test(ConfirmModal): 스토리 추가
Creative-Lee Jun 4, 2023
c80effa
test(DetailPriceSection): 스토리 추가
Creative-Lee Jun 4, 2023
c5d18f4
test(EmptyCartSection): 스토리 추가
Creative-Lee Jun 4, 2023
f8f9492
test(LoadingErrorCard): 스토리 추가
Creative-Lee Jun 4, 2023
17f69e6
test(OrderCard): 스토리 추가
Creative-Lee Jun 4, 2023
dad5a72
test(OrderCardList): 스토리 추가
Creative-Lee Jun 4, 2023
f13e98e
test(ProductCard): 스토리 추가
Creative-Lee Jun 4, 2023
9012be7
test(ProductCardList): 스토리 추가
Creative-Lee Jun 4, 2023
261f0cd
refactor(EmptyDataCard): 컴포넌트 재활용을 위한 개선
Creative-Lee Jun 4, 2023
e7a9788
chore: 이미지 파일명 변경
Creative-Lee Jun 4, 2023
223fde2
refactor: EmptyDataCard 컴포넌트 적용
Creative-Lee Jun 4, 2023
f59ee2b
chore: 불필요한 코드 삭제
Creative-Lee Jun 4, 2023
e1885c5
test(EmptyDataCard): props 추가로 인한 description 추가
Creative-Lee Jun 4, 2023
66aad1b
test: 스토리 grouping
Creative-Lee Jun 4, 2023
cc6dba1
test(Modal): props description 추가
Creative-Lee Jun 4, 2023
926db75
design: 장바구니 상품 이미지 css 개선
Creative-Lee Jun 4, 2023
ec2d700
fix(useShoppingCart): 선택 삭제 함수의 버그 수정
Creative-Lee Jun 4, 2023
e78e47e
feat: 장바구니 총 합산 가격 api 추가로 인한 로직 구현
Creative-Lee Jun 4, 2023
f800690
feat: 장바구니 총 합산 가격 selector 구현
Creative-Lee Jun 4, 2023
a2edfd6
chore: 크로마틱 설치 및 스크립트 추가
Creative-Lee Jun 4, 2023
e360023
design: sticky 속성 관련 px 미세조정
Creative-Lee Jun 5, 2023
dafba30
test: 스토리 표시 오류 수정
Creative-Lee Jun 5, 2023
16c6114
refactor: header suspense 제거 및 Loadable 처리
Creative-Lee Jun 5, 2023
1f31d71
design: 상품 목록 타이틀 추가 및 상품 이미지 css 조정
Creative-Lee Jun 5, 2023
d7a6fee
feat: 디바운스 유틸 구현
Creative-Lee Jun 5, 2023
8092c45
docs: README.md 추가
Creative-Lee Jun 5, 2023
f3b0494
chore: 새로고침 아이콘 추가
Creative-Lee Jun 5, 2023
37571c4
refactor: 포인트 요청 에러시 새로고침 기능 추가
Creative-Lee Jun 5, 2023
56d2e93
refactor: 분리된 2개의 분기 삼항식 적용
Creative-Lee Jun 9, 2023
ef488dc
refactor: 불필요한 useCallback 적용 코드 제거
Creative-Lee Jun 9, 2023
425dd52
refactor:(useOrder): api 성공시에만 후행로직이 실행되도록 개선
Creative-Lee Jun 9, 2023
a69c602
refactor: 인라인 선언으로 매번 생성되는 함수 상단에 선언
Creative-Lee Jun 9, 2023
a3aad30
refactor(SelectBox): 컴포넌트 및 사용처에 memoization 적용
Creative-Lee Jun 9, 2023
70ac1ce
refactor: 구조분해 할당 적용으로 코드 정리
Creative-Lee Jun 9, 2023
15d40a7
refactor: 외부 의존성 없는 함수 useCallback 적용
Creative-Lee Jun 9, 2023
6773b3d
refactor: 의도에 맞지않는 map 함수를 forEach로 변경
Creative-Lee Jun 9, 2023
8c498b7
refactor(CheckOutPointCostProvider): state, dispatch context 분리
Creative-Lee Jun 9, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,13 @@

# misc
.DS_Store
.env
.env.local
.env.development.local
.env.test.local
.env.production.local
.env.production
.env.development

npm-debug.log*
yarn-debug.log*
Expand Down
1 change: 1 addition & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const config: StorybookConfig = {
'@storybook/addon-essentials',
'@storybook/preset-create-react-app',
'@storybook/addon-interactions',
'storybook-addon-react-router-v6',
],
framework: {
name: '@storybook/react-webpack5',
Expand Down
5 changes: 5 additions & 0 deletions .storybook/preview-head.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<link
rel="stylesheet"
type="text/css"
href="https://cdn.jsdelivr.net/gh/orioncactus/pretendard/dist/web/static/pretendard.css"
/>
53 changes: 35 additions & 18 deletions .storybook/preview.tsx
Original file line number Diff line number Diff line change
@@ -1,31 +1,38 @@
import React from 'react';
import type { Preview } from '@storybook/react';
import { RecoilRoot } from 'recoil';
import { BrowserRouter } from 'react-router-dom';
import { withThemeFromJSXProvider } from '@storybook/addon-styling';
import { initialize, mswDecorator } from 'msw-storybook-addon';
import GlobalStyles from '../src/styles/GlobalStyles';
import { RecoilRoot } from 'recoil';
import type { Preview } from '@storybook/react';
import handler from '../src/mocks/handlers';
import { CheckOutPointCostProvider } from '../src/context/CheckOutPointCostProvider';

const customViewport = {
Default: {
name: 'FHD',
styles: {
width: '1920px',
height: '1080px',
},
},
HD: {
name: 'HD',
styles: {
width: '1280px',
height: '720px',
},
},

FHD: {
name: 'FHD',
styles: {
width: '1920px',
height: '1080px',
},
},

tablet: {
name: 'tablet',
styles: {
width: '768px',
height: '1024px',
},
},

mobile: {
name: 'mobile',
styles: {
Expand All @@ -35,6 +42,8 @@ const customViewport = {
},
};

initialize({ serviceWorker: { url: `${process.env.PUBLIC_URL}/mockServiceWorker.js` } });

const preview: Preview = {
parameters: {
actions: { argTypesRegex: '^on[A-Z].*' },
Expand All @@ -48,16 +57,24 @@ const preview: Preview = {
viewports: { ...customViewport },
defaultViewport: 'Default',
},
msw: {
handlers: [...handler],
},
},
decorators: [
(Story) => (
<BrowserRouter>
<RecoilRoot>
<CheckOutPointCostProvider>
<Story />
</CheckOutPointCostProvider>
</RecoilRoot>
</BrowserRouter>
),

mswDecorator,
withThemeFromJSXProvider({ GlobalStyles }),
],
};

export default preview;

export const decorators = [
(Story) => (
<RecoilRoot>
<Story />
</RecoilRoot>
),
withThemeFromJSXProvider({ GlobalStyles }),
];
34 changes: 26 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,36 @@
<p align="middle">React & Redux 장바구니 협업 미션</p>
</p>

## 🚀 Getting Started
## 😀데모 페이지에서 바로 즐기기 :)

백엔드와의 협업을 통해 실제 동작하는 애플리케이션을 만듭니다.
[🎯데모 페이지](https://react-dobob-shopping-cart.netlify.app/)
[🎯스토리북](https://647ca9d2fde3abc441368a22-pwcyjzwguy.chromatic.com/)

<br>
---

## 👏 Contributing
## 어플리케이션 실행 방법!

만약 미션 수행 중에 개선사항이 보인다면, 언제든 자유롭게 PR을 보내주세요.
### 1. 패키지 다운받기

<br>
```bash
npm i
```

## 🐞 Bug Report
위 명령어로 필요한 패키지를 다운로드해 주세요!

버그를 발견한다면, [Issues](https://github.com/woowacourse/react-shopping-cart-prod/issues)에 등록해주세요.
### 2. 프로젝트 실행

```bash
npm run start
```

위 명령어를 터미널에 입력해주세요!

### 3. 쇼핑😀

```
원하는 상품을 마음껏 담고 구매하세요!
무료로 쇼핑하는데, 구매시 10% 포인트 적립까지!

🤑사장님이 미쳤어요🤑
```
26 changes: 26 additions & 0 deletions docs/REQUIREMENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# 레벨2 - 장바구니 협업-step2

## 기능 구현 목록

- 주문서 페이지
- 주문 상품 탭
- [x] 마크업
- [x] 주문할 상품 목록을 보여준다.
- 포인트 할인 탭
- [x] 마크업
- [x] 포인트 GET 요청을 통해 보유 포인트를 보여준다.
- [x] 전액사용 버튼을 눌러 보유 포인트를 모두 사용한다.
- 주문 가격 탭
- [ ] 마크업
- [ ] 정책에 따라 배송비 할인을 적용한다.
- [ ] 사용 포인트를 반영해 최종 결제 금액을 보여준다.
- [ ] 최종 결제 금액에 따라 적립 예정 포인트를 보여준다.
- 주문 목록 페이지
- [ ] 마크업
- [ ] 주문목록 GET 요청을 통해 주문 목록을 보여준다.
- [ ] 각 주문을 눌러 주문 상세 페이지로 이동할 수 있다.
- 주문 상세 페이지
- [ ] 마크업
- [ ] 개별주문 GET 요청을 통해 주문 상세를 보여준다.
- [ ] 총 결제 금액, 할인 금액, 최종 결제 금액을 보여준다.
- [ ] 할인 금액은 배송비, 포인트 별로 보여준다.
Loading