From 4fa7596a306a093a90c8d5bf83ee4ac04d064767 Mon Sep 17 00:00:00 2001 From: TaeeunKim Date: Thu, 8 Jun 2023 22:23:46 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EC=8A=A4=ED=86=A0=EB=A6=AC=EB=B6=81=20?= =?UTF-8?q?=EC=98=A4=EB=A5=98=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CartItemList/CartItemList.stories.tsx | 4 +++ .../Order/OrderItem/OrderItem.stories.tsx | 1 + src/mocks/cartList.json | 26 +++++++++++++++++++ src/mocks/orderList.json | 3 +++ 4 files changed, 34 insertions(+) create mode 100644 src/mocks/cartList.json diff --git a/src/components/Cart/CartItemList/CartItemList.stories.tsx b/src/components/Cart/CartItemList/CartItemList.stories.tsx index 6d233b11b4..9074ae4a32 100644 --- a/src/components/Cart/CartItemList/CartItemList.stories.tsx +++ b/src/components/Cart/CartItemList/CartItemList.stories.tsx @@ -1,10 +1,14 @@ import { Meta, StoryObj } from '@storybook/react'; import CartItemList from '.'; +import data from '../../../mocks/cartList.json'; const cartItemList = { component: CartItemList, title: 'Cart/CartItemList', tags: ['autodocs'], + args: { + cartList: data, + }, } satisfies Meta; export default cartItemList; diff --git a/src/components/Order/OrderItem/OrderItem.stories.tsx b/src/components/Order/OrderItem/OrderItem.stories.tsx index 09e5c0c34b..0eca8fb014 100644 --- a/src/components/Order/OrderItem/OrderItem.stories.tsx +++ b/src/components/Order/OrderItem/OrderItem.stories.tsx @@ -7,6 +7,7 @@ const mock = { name: '깜짝 놀란 춘식이', imageUrl: 'https://pbs.twimg.com/profile_images/1641252178450083841/Cn2MUfHG_400x400.jpg', + price: 10000, totalPrice: 30000, totalDiscountPrice: 10000, }; diff --git a/src/mocks/cartList.json b/src/mocks/cartList.json new file mode 100644 index 0000000000..e829fe9025 --- /dev/null +++ b/src/mocks/cartList.json @@ -0,0 +1,26 @@ +[ + { + "id": 1, + "quantity": 5, + "product": { + "id": 1, + "price": 10000, + "name": "오히려 좋은 춘식이", + "imageUrl": "https://item.kakaocdn.net/do/91481c46c6ee38c33e20deba29e1f73ff604e7b0e6900f9ac53a43965300eb9a", + "isOnSale": true, + "salePrice": 4000 + } + }, + { + "id": 2, + "quantity": 3, + "product": { + "id": 3, + "price": 30000, + "name": "힝 춘식이", + "imageUrl": "https://item.kakaocdn.net/do/91481c46c6ee38c33e20deba29e1f73f15b3f4e3c2033bfd702a321ec6eda72c", + "isOnSale": false, + "salePrice": 0 + } + } +] diff --git a/src/mocks/orderList.json b/src/mocks/orderList.json index bc96250ff7..dab6b6b64e 100644 --- a/src/mocks/orderList.json +++ b/src/mocks/orderList.json @@ -7,6 +7,7 @@ "id": 1, "name": "오히려 좋은 춘식이", "imageUrl": "https://item.kakaocdn.net/do/91481c46c6ee38c33e20deba29e1f73ff604e7b0e6900f9ac53a43965300eb9a", + "price": 10000, "totalPrice": 7000, "totalDiscountPrice": 1000, "quantity": 3 @@ -15,6 +16,7 @@ "id": 2, "name": "힝 춘식이", "imageUrl": "https://item.kakaocdn.net/do/91481c46c6ee38c33e20deba29e1f73f15b3f4e3c2033bfd702a321ec6eda72c", + "price": 10000, "totalPrice": 7000, "totalDiscountPrice": 1000, "quantity": 3 @@ -29,6 +31,7 @@ "id": 1, "name": "오히려 좋은 춘식이", "imageUrl": "https://item.kakaocdn.net/do/91481c46c6ee38c33e20deba29e1f73ff604e7b0e6900f9ac53a43965300eb9a", + "price": 10000, "totalPrice": 7000, "totalDiscountPrice": 1000, "quantity": 3