feat:9주차 123미션 - #93
Open
kimdoyeon1234 wants to merge 18 commits into
Open
Conversation
yewon20804
reviewed
Jun 2, 2026
yewon20804
left a comment
Collaborator
There was a problem hiding this comment.
9주차 미션 1,2,3 수고하셨습니다 ! Redux Toolkit과 Zustand 두 가지 방식 모두 구현하셨고, 구조가 깔끔하게 분리되어 있어요 👍 아래 코멘트 확인해주세요 !
1. week9/src/store/useCartStore.ts — decrease 로직 경계 조건
// 현재 코드
.filter((item) => item.amount >= 1);
// ✅ 더 명확한 표현
.filter((item) => item.amount > 0);
amount가 0이 되어도 filter로 제거되기 전에 잠깐 0인 상태가 화면에 보일 수 있습니다. 현재 구현은 >= 1로 필터링하므로 실제로는 0인 아이템이 렌더링되기 직전에 제거됩니다. 이 자체는 문제없지만, amount < 1이 아닌 amount === 0으로 작성하면 의도가 더 명확할 것 같아요 !
2. week9/src/constants/cartItems.ts — price 타입이 string인데 숫자 연산에 사용됨
// 현재 코드
export interface CartItemType {
price: string; //
}
// ✅ 수정
export interface CartItemType {
price: number;
}
// 데이터도 따옴표 제거
{ price: 25000, ... } // ✅
{ price: '25000', ... } // ❌
price가 string으로 선언되어 있는데 calculateTotals에서 Number(item.price)로 변환해서 쓰고 있습니다 ! 처음부터 number로 선언하면 더 명확하고 간단하게 사용 가능합니다 !
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📌 작업 내용
Redux Toolkit과 Zustand를 활용한 음반 장바구니(PLAY LIST) 상태 관리 및 전역 모달 UI 기능 구현
✨ 상세 작업 내용
📸 스크린샷
✅ 체크리스트