Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
f485074
📝 : step2 요구사항 정리
usageness May 17, 2022
cc03fea
📦 : MSW 패키지 설치
usageness May 17, 2022
0fedbdb
🔧 : MSW 이용을 위해 프로젝트 세팅
usageness May 17, 2022
4e8b059
♻️ : router 로직 ShoppingCartApp.jsx로 이동
usageness May 17, 2022
101b341
✨ : 상품 상세 관련 action type 및 api 로직 추가
usageness May 17, 2022
81b8092
✨ : 상품 상세 페이지 구현
usageness May 17, 2022
1fbcc7e
💄 : style 적용 및 색상 팔레트 리팩토링
usageness May 17, 2022
f41ab22
♻️ : 이미지 데이터 이름을 thumbnail로 통일
usageness May 18, 2022
627e0fb
♻️ : useNavigate를 Link로 변경
usageness May 18, 2022
3fed158
✨ : CheckBox 컴포넌트 구현
usageness May 18, 2022
1c145fa
✨ : 장바구니 페이지 마크업 구현
usageness May 18, 2022
84fefab
✨ : 장바구니 기존 상품 추가시 물품 수가 증가하도록 구현
usageness May 18, 2022
9dc6a2d
🤡 : 전체 상품 요청 mock data 추가 및 적용
usageness May 18, 2022
7831593
♻️ : 리듀서의 필요없던 스프레드 연산자 삭제
usageness May 19, 2022
66f3b88
✨ : 장바구니 물품 삭제 기능 구현
usageness May 19, 2022
8af9291
🏗️ : 상위 컴포넌트에서 관리되도록 CheckBox 로직 변경
usageness May 19, 2022
b9213da
✨ : 장바구니 물품 선택/다중 삭제 기능 구현
usageness May 19, 2022
47f8519
✨ : 체크 된 상품들의 총 가격을 표시하도록 구현
usageness May 19, 2022
8447452
✨ : 장바구니 상품 구매 수량 수정 기능 구현
usageness May 19, 2022
266694c
💄 : 스타일 추가, 개발 편의를 위한 API 요청 예외 처리
usageness May 19, 2022
51994f2
♻️ : checkbox 관련 로직 custom hook으로 분리
usageness May 19, 2022
32a6a0e
💄 : 기존 컨벤션에 맞게 style 변경
usageness May 19, 2022
d5cf83a
♻️ : 장바구니의 결제에상금액 부분 별도 컴포넌트로 분리
usageness May 20, 2022
2e4fcaf
♻️ : 장바구니의 상품 목록 별도 컴포넌트로 분리
usageness May 20, 2022
a13ab54
♻️ : 페이지 헤더 부분 별도 컴포넌트로 분리
usageness May 20, 2022
d65cc8e
🐛 : 체크박스가 정상적으로 동작하지 않던 버그 수정
usageness May 21, 2022
aa13932
🐛 : 체크한 상태로 상품 삭제시 오류가 발생하는 버그 수정
usageness May 21, 2022
b74a570
🔇 : console.log 삭제
usageness May 21, 2022
7d3cf4e
🐛 : 스토리북이 제대로 표기되지 않던 문제 해결
usageness May 21, 2022
af046c4
✅ : storybook UI 테스트 작성
usageness May 21, 2022
c3055ed
📦 : test 관련 라이브러리 설치
usageness May 21, 2022
a6982ce
✅ : 단위 테스트 추가
usageness May 21, 2022
b4805e9
📝 : 요구사항 문서 최신화
usageness May 21, 2022
72571d5
📦 : storybook 배포를 위한 chromatic 설치
usageness May 21, 2022
1af7806
📝 : gitignore가 모든 env 파일을 무시하도록 수정
usageness May 23, 2022
21d4dc8
🔒️ : 민감한 정보 (체크섬, 토큰) 가 공개되지 않도록 수정
usageness May 23, 2022
438c626
✏️ : 상수 네이밍 변경
usageness May 23, 2022
348f76f
✏️ : useCheckBox의 deleteSelectedItem 함수 이름 변경
usageness May 23, 2022
2c26193
♻️ : 체크 로직을 가시성 있는 고차함수로 변경
usageness May 23, 2022
aaeea04
♻️ : useCartItem Hook 추가
usageness May 23, 2022
1ac6270
🚨 : eslint function-paren-newline 해제
usageness May 26, 2022
9260dda
♻️ : useCheckBox 구조 개선
usageness May 26, 2022
1026e65
🔧 : storybook config 파일 생성 및 적용
usageness May 26, 2022
3d33218
♻️ : cart reducer의 forEach를 map, filter로 변경
usageness May 26, 2022
eb6be21
✨ : 비동기 액션에 PENDING 상태 추가
usageness May 27, 2022
4df57e8
✨ : 상품 상세 페이지 로딩시 스켈레톤 애니메이션 추가
usageness May 27, 2022
bda239e
♻️ : reducer 테스트 코드 함수로 중복 제거
usageness May 27, 2022
42da63b
♻️ : 장바구니 액션 로직 변경
usageness May 27, 2022
1e7ab35
💄 : Container, Wrapper 구분 적용
usageness May 27, 2022
669440b
🔧 : 스토리북 템플릿 전역 설정
usageness May 27, 2022
1628fe8
🚨 : console.log 제거
usageness May 27, 2022
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
1 change: 0 additions & 1 deletion .env.development

This file was deleted.

1 change: 0 additions & 1 deletion .env.production

This file was deleted.

4 changes: 3 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
"import/prefer-default-export": "off",
"class-methods-use-this": "off",
"consistent-return": "off",
"default-param-last": "off"
"default-param-last": "off",
"react/forbid-prop-types": "off",
"function-paren-newline": "off"
}
}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,14 @@
# misc
.DS_Store
.env.local
.env.development
.env.development.local
.env.test.local
.env.production
.env.production.local

npm-debug.log*
*.log

/.vscode
/storybook-static
20 changes: 20 additions & 0 deletions .storybook/config/snackbarReducer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { 스낵바_액션 } from 'actions/types';

const initialState = {
visible: true,
message: '스낵바 메시지입니다😊',
};

export default (state = initialState, action) => {
const { type, payload } = action;

switch (type) {
case 스낵바_액션.PUSH_MESSAGE:
return { visible: true, message: payload };

case 스낵바_액션.HIDE_MESSAGE:
return { visible: false, message: '' };
default:
return state;
}
};
10 changes: 10 additions & 0 deletions .storybook/config/snackbarStore.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { createStore, applyMiddleware, combineReducers } from 'redux';
import ReduxThunk from 'redux-thunk';
import ReduxLogger from 'redux-logger';
import snackbar from './snackbarReducer';
import { composeWithDevTools } from 'redux-devtools-extension';

export default createStore(
combineReducers({ snackbar }),
composeWithDevTools(applyMiddleware(ReduxThunk, ReduxLogger)),
);
29 changes: 27 additions & 2 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,34 @@
import { addDecorator } from '@storybook/react';
import { Provider } from 'react-redux';
import { BrowserRouter, Route, Routes } from 'react-router-dom';
import { Global } from '@emotion/react';

import store from 'store';

import GlobalStyles from 'styles/GlobalStyles';
import Snackbar from 'components/Snackbar';
import snackbarStore from './config/snackbarStore';

addDecorator((story) => (
<Provider store={store}>
<Provider store={snackbarStore}>
<Global styles={GlobalStyles} />
<Snackbar />
<BrowserRouter>
<Routes>
<Route path="*" element={story()} />
</Routes>
</BrowserRouter>
</Provider>
</Provider>
));

export const parameters = {
actions: { argTypesRegex: "^on[A-Z].*" },
actions: { argTypesRegex: '^on[A-Z].*' },
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/,
},
},
}
};
12 changes: 10 additions & 2 deletions REQUIREMENTS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# 🚩 기능 요구사항

- [x] 메인 화면에서 현재 판매중인 상품들을 볼 수 있어야한다.
- [x] 장바구니 버튼을 눌러 상품을 장바구니에 담을 수 있어야한다.
- [x] 메인 화면에서 현재 판매중인 상품들을 볼 수 있어야 한다.
- [x] 장바구니 버튼을 눌러 상품을 장바구니에 담을 수 있어야 한다.
- [x] JSON 서버를 통하여 상품 목록을 불러올 수 있어야 한다.
- [x] 장바구니 페이지에서 장바구니에 담긴 상태를 확인할 수 있어야 한다.
- [x] 상세정보 페이지에서 특정 상품의 상세 정보를 확인할 수 있어야 한다.
- [x] MSW를 활용하여 API를 Mocking 하여야 한다.

# ✔️ 테스트 요구사항

- [x] 구현 사항에 대해 단위 테스트를 진행하여야 한다.
- [x] 스토리북을 이용해 컴포넌트의 UI를 확인할 수 있어야 한다.
Loading