From e198d47b22766d9d9d167ded4c75bf0f345e8514 Mon Sep 17 00:00:00 2001 From: gimdogyun Date: Tue, 19 Nov 2024 22:50:19 +0900 Subject: [PATCH 1/7] refactor: intro - #146 --- .../features/IntroductionPage/Introduction.tsx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/components/features/IntroductionPage/Introduction.tsx b/src/components/features/IntroductionPage/Introduction.tsx index eb49bb7..5a5f858 100644 --- a/src/components/features/IntroductionPage/Introduction.tsx +++ b/src/components/features/IntroductionPage/Introduction.tsx @@ -8,17 +8,18 @@ import Intro7 from "@assets/Image/Intro/Intro7.png"; import Intro8 from "@assets/Image/Intro/Intro8.png"; import Image from "@components/common/Image"; import ImageCard from "@components/common/ImageCard"; +import size from "@constants/size"; const Introduction = () => ( - + - + 우리가 꿈꾸는 내일, 농민과 고객이 함께 만드는 새로운 유통 - + 품앗이 이야기 @@ -87,7 +88,7 @@ const Introduction = () => ( Intro6 - + 농업인의 땀과 소비자의 마음을 직접 이어,
@@ -132,7 +133,7 @@ const Introduction = () => (
- + ); export default Introduction; From d8329a0c29e82b428fcd3993706a5f11b3225b68 Mon Sep 17 00:00:00 2001 From: gimdogyun Date: Wed, 20 Nov 2024 00:16:39 +0900 Subject: [PATCH 2/7] fix: wishlist api - #146 --- src/api/wishlistApi.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/api/wishlistApi.ts b/src/api/wishlistApi.ts index 8625908..1a777e2 100644 --- a/src/api/wishlistApi.ts +++ b/src/api/wishlistApi.ts @@ -7,13 +7,13 @@ type WishlistData = { const useCreateWishlists = () => { const fetcher = (wishlistData: WishlistData) => - defaultApi.post(`/api/wishlist/{product_id}`, wishlistData).then(({ data }) => data); + defaultApi.post(`/api/v1/wishlist/{product_id}`, wishlistData).then(({ data }) => data); return useMutation({ mutationFn: fetcher }); }; -const useGetWishlists = () => { - const fetcher = () => needAuthDefaultApi.get(`/api/wishlist`).then(({ data }) => data); +const useGetWishlists = (type: "product" | "farm") => { + const fetcher = () => needAuthDefaultApi.get(`/api/v1/wishlist`, { params: { type } }).then(({ data }) => data); return useQuery({ queryKey: ["wishlists"], @@ -22,7 +22,7 @@ const useGetWishlists = () => { }; const useDeleteWishlists = () => { - const fetcher = (wishlistId: number) => defaultApi.delete(`/api/wishlist/${wishlistId}`).then(({ data }) => data); + const fetcher = (wishlistId: number) => defaultApi.delete(`/api/v1/wishlist/${wishlistId}`).then(({ data }) => data); return useMutation({ mutationFn: fetcher }); }; From 0004e24b81f6490208f19a999a12fbcb909c1f1a Mon Sep 17 00:00:00 2001 From: gimdogyun Date: Wed, 20 Nov 2024 00:19:39 +0900 Subject: [PATCH 3/7] fix: farmdetail - #146 --- .../FarmDetailPage/ProductDescription.tsx | 93 ------------------- .../{Product.tsx => Schedule.tsx} | 6 +- src/pages/FarmDetailPage/index.tsx | 24 +++-- 3 files changed, 19 insertions(+), 104 deletions(-) delete mode 100644 src/components/features/FarmDetailPage/ProductDescription.tsx rename src/components/features/FarmDetailPage/{Product.tsx => Schedule.tsx} (97%) diff --git a/src/components/features/FarmDetailPage/ProductDescription.tsx b/src/components/features/FarmDetailPage/ProductDescription.tsx deleted file mode 100644 index 3d99cf7..0000000 --- a/src/components/features/FarmDetailPage/ProductDescription.tsx +++ /dev/null @@ -1,93 +0,0 @@ -import { Box, Text, Flex } from "@chakra-ui/react"; -import { useGetFarmDetail } from "@api/farmApi"; -import Image from "@components/common/Image"; - -const defaultInfo = { - title: "", - mainImage: "", - detailTitles: ["", "", ""], - detailDescriptions: ["", "", ""], - detailImages: ["", "", ""], -}; - -const ProductDescription = ({ scheduleId }: { scheduleId: number }) => { - const { data: farmDetail = defaultInfo } = useGetFarmDetail(scheduleId); - - return ( - - - {farmDetail.title} - - - mainImage - - - - - - {farmDetail.detailTitles[0]} - - - {farmDetail.detailDescriptions[0]} - - - detailImage - - - - - - - {farmDetail.detailTitles[1]} - - - {farmDetail.detailDescriptions[1]} - - - detailImage - - - - - - - {farmDetail.detailTitles[2]} - - - {farmDetail.detailDescriptions[2]} - - - detailImage - - - - - - ); -}; - -export default ProductDescription; diff --git a/src/components/features/FarmDetailPage/Product.tsx b/src/components/features/FarmDetailPage/Schedule.tsx similarity index 97% rename from src/components/features/FarmDetailPage/Product.tsx rename to src/components/features/FarmDetailPage/Schedule.tsx index d75cef2..7fd53f9 100644 --- a/src/components/features/FarmDetailPage/Product.tsx +++ b/src/components/features/FarmDetailPage/Schedule.tsx @@ -17,7 +17,7 @@ const defaultFormData = { endTime: "", }; -const Product = ({ scheduleId }: { scheduleId: number }) => { +const Schedule = ({ scheduleId }: { scheduleId: number }) => { const { data: farmDetail = defaultFormData } = useGetFarmDetail(scheduleId); const [dateOptions, setDateOptions] = useState([]); @@ -38,7 +38,7 @@ const Product = ({ scheduleId }: { scheduleId: number }) => { return ( - + farmImage @@ -144,4 +144,4 @@ const Product = ({ scheduleId }: { scheduleId: number }) => { ); }; -export default Product; +export default Schedule; diff --git a/src/pages/FarmDetailPage/index.tsx b/src/pages/FarmDetailPage/index.tsx index 7473b06..c5ff0a0 100644 --- a/src/pages/FarmDetailPage/index.tsx +++ b/src/pages/FarmDetailPage/index.tsx @@ -1,9 +1,9 @@ import { useParams } from "react-router-dom"; -import { Tab, Tabs, TabList, TabPanels, TabPanel } from "@chakra-ui/react"; +import { Tab, Tabs, TabList, TabPanels, TabPanel, Flex } from "@chakra-ui/react"; +import AddPreview from "@components/common/AddPreview"; import Direction from "@components/features/FarmDetailPage/Direciton"; -import Product from "@components/features/FarmDetailPage/Product"; -import ProductDescription from "@components/features/FarmDetailPage/ProductDescription"; import ReviewList from "@components/features/FarmDetailPage/ReviewList"; +import Schedule from "@components/features/FarmDetailPage/Schedule"; const FarmDetailPage = () => { const params = useParams(); @@ -11,10 +11,10 @@ const FarmDetailPage = () => { const scheduleId = Number(params?.scheduleId); return ( - <> - + + - + 상품 설명 후기 @@ -22,7 +22,15 @@ const FarmDetailPage = () => { - + @@ -31,7 +39,7 @@ const FarmDetailPage = () => { - + ); }; From f201f724349081fac4432e75d428202078beee0a Mon Sep 17 00:00:00 2001 From: gimdogyun Date: Wed, 20 Nov 2024 00:20:01 +0900 Subject: [PATCH 4/7] fix: storedetail - #146 --- .../features/StoreDetailPage/Product.tsx | 2 +- .../StoreDetailPage/ProductDescription.tsx | 69 ------------------- src/pages/StoreDetailPage/index.tsx | 20 ++++-- 3 files changed, 15 insertions(+), 76 deletions(-) delete mode 100644 src/components/features/StoreDetailPage/ProductDescription.tsx diff --git a/src/components/features/StoreDetailPage/Product.tsx b/src/components/features/StoreDetailPage/Product.tsx index 78c6b24..b615310 100644 --- a/src/components/features/StoreDetailPage/Product.tsx +++ b/src/components/features/StoreDetailPage/Product.tsx @@ -36,7 +36,7 @@ const Product: React.FC = ({ productId }) => { return ( - + product diff --git a/src/components/features/StoreDetailPage/ProductDescription.tsx b/src/components/features/StoreDetailPage/ProductDescription.tsx deleted file mode 100644 index 18f23b7..0000000 --- a/src/components/features/StoreDetailPage/ProductDescription.tsx +++ /dev/null @@ -1,69 +0,0 @@ -import { Box, Image, Text, Flex } from "@chakra-ui/react"; -import store1 from "@assets/Image/Store/Store1.png"; -import store5 from "@assets/Image/Store/Store5.png"; -import store6 from "@assets/Image/Store/Store6.png"; -import store7 from "@assets/Image/Store/Store7.png"; - -const ProductDescription = () => ( - - - 건호네 포도에 대해서 소개합니다😀 - - - store1 - - - - - - 신선함의 상징 - - - 매일 아침 수확한 포도를 즉시 배송하여, -
- 여러분의 식탁에 가장 신선한 맛을 전해드립니다. -
-
- store5 -
-
- - - - - 건강한 선택 - - - 포도는 비타민과 항산화 물질이 풍부하여 -
- 면역력 강화와 피부 건강에 도움을 줍니다. -
- 자연 그대로의 맛을 느끼며 건강을 챙기세요. -
-
- store6 -
-
- - - - - 다채로운 활용 - - - 포도는 샐러드, 디저트, 주스 등 -
- 다양한 요리에 활용할 수 있습니다. -
- 창의적인 레시피와 함께 포도의 매력을 만끽하세요! -
-
- store7 -
-
-
-
-
-); - -export default ProductDescription; diff --git a/src/pages/StoreDetailPage/index.tsx b/src/pages/StoreDetailPage/index.tsx index e29788f..4cb3c81 100644 --- a/src/pages/StoreDetailPage/index.tsx +++ b/src/pages/StoreDetailPage/index.tsx @@ -1,12 +1,12 @@ -import { Tab, Tabs, TabList, TabPanels, TabPanel } from "@chakra-ui/react"; +import { Tab, Tabs, TabList, TabPanels, TabPanel, Flex } from "@chakra-ui/react"; +import AddPreview from "@components/common/AddPreview"; import Product from "@components/features/StoreDetailPage/Product"; -import ProductDescription from "@components/features/StoreDetailPage/ProductDescription"; import ReviewList from "@components/features/StoreDetailPage/ReviewList"; const StoreDetailPage = () => ( - <> + - + 상품 설명 후기 @@ -14,14 +14,22 @@ const StoreDetailPage = () => ( - + - + ); export default StoreDetailPage; From af133c44b64626f47cead30e3f21c660883cf5e7 Mon Sep 17 00:00:00 2001 From: gimdogyun Date: Wed, 20 Nov 2024 00:20:18 +0900 Subject: [PATCH 5/7] fix: mypage - #146 --- src/components/features/MyPage/Category.tsx | 2 +- src/components/features/MyPage/Wishlist/ProductWish.tsx | 2 +- src/components/layouts/MyPageLayout.tsx | 3 ++- src/pages/MyPage/OrdersPage.tsx | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/components/features/MyPage/Category.tsx b/src/components/features/MyPage/Category.tsx index ed49546..36227da 100644 --- a/src/components/features/MyPage/Category.tsx +++ b/src/components/features/MyPage/Category.tsx @@ -3,7 +3,7 @@ import { HeartOutlined, ProfileOutlined, UserOutlined } from "@ant-design/icons" import { Text, Flex, Box, Icon, Link as ChakraLink } from "@chakra-ui/react"; const Category = () => ( - + diff --git a/src/components/features/MyPage/Wishlist/ProductWish.tsx b/src/components/features/MyPage/Wishlist/ProductWish.tsx index b18a65a..a4cf0e0 100644 --- a/src/components/features/MyPage/Wishlist/ProductWish.tsx +++ b/src/components/features/MyPage/Wishlist/ProductWish.tsx @@ -12,7 +12,7 @@ type Product = { }; const ProductWish = () => { - const { data: wishlists, isLoading, refetch } = useGetWishlists(); + const { data: wishlists, isLoading, refetch } = useGetWishlists("product"); const { mutate: deleteWishlist } = useDeleteWishlists(); const handleDelete = (wishlistId: number) => { diff --git a/src/components/layouts/MyPageLayout.tsx b/src/components/layouts/MyPageLayout.tsx index 271fec3..c615d7f 100644 --- a/src/components/layouts/MyPageLayout.tsx +++ b/src/components/layouts/MyPageLayout.tsx @@ -1,9 +1,10 @@ import { Outlet } from "react-router-dom"; import { Flex } from "@chakra-ui/react"; import Category from "@components/features/MyPage/Category"; +import size from "@constants/size"; const MyPageLayout = () => ( - + diff --git a/src/pages/MyPage/OrdersPage.tsx b/src/pages/MyPage/OrdersPage.tsx index 1341c76..b4a7f2e 100644 --- a/src/pages/MyPage/OrdersPage.tsx +++ b/src/pages/MyPage/OrdersPage.tsx @@ -18,7 +18,7 @@ const splitedOrders = sortedOrders.reduce((acc, cur) => { }, []); const MyOrdersPage = () => ( - + {splitedOrders.map(orders => ( {orders[0].orderDate} From 5b9fb29c4169a9b73401c49211669237c1433062 Mon Sep 17 00:00:00 2001 From: gimdogyun Date: Wed, 20 Nov 2024 00:20:34 +0900 Subject: [PATCH 6/7] fix: sellerpage - #146 --- src/components/features/SellerPage/BusinessRegister/index.tsx | 2 +- src/components/features/SellerPage/MyInfo/Logout.tsx | 2 +- src/components/features/SellerPage/Tax.tsx/index.tsx | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/features/SellerPage/BusinessRegister/index.tsx b/src/components/features/SellerPage/BusinessRegister/index.tsx index aee2764..9bfc3b3 100644 --- a/src/components/features/SellerPage/BusinessRegister/index.tsx +++ b/src/components/features/SellerPage/BusinessRegister/index.tsx @@ -68,7 +68,7 @@ const BusinessRegister = () => { }; return ( - + {alert && ( diff --git a/src/components/features/SellerPage/MyInfo/Logout.tsx b/src/components/features/SellerPage/MyInfo/Logout.tsx index 1baf3e9..04e72a7 100644 --- a/src/components/features/SellerPage/MyInfo/Logout.tsx +++ b/src/components/features/SellerPage/MyInfo/Logout.tsx @@ -9,7 +9,7 @@ const Logout = () => { }; return ( - + 회원 탈퇴 diff --git a/src/components/features/SellerPage/Tax.tsx/index.tsx b/src/components/features/SellerPage/Tax.tsx/index.tsx index cdcb510..69aafed 100644 --- a/src/components/features/SellerPage/Tax.tsx/index.tsx +++ b/src/components/features/SellerPage/Tax.tsx/index.tsx @@ -24,7 +24,7 @@ const Tax = () => { }; return ( - + 세금 계산기 From be97a81e9b81af2aa23d94226e2114e7435e0373 Mon Sep 17 00:00:00 2001 From: gimdogyun Date: Wed, 20 Nov 2024 00:20:43 +0900 Subject: [PATCH 7/7] fix: header - #146 --- src/components/layouts/Header.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/layouts/Header.tsx b/src/components/layouts/Header.tsx index 6f63bc7..3cc42ec 100644 --- a/src/components/layouts/Header.tsx +++ b/src/components/layouts/Header.tsx @@ -67,7 +67,7 @@ const Header = () => { {loginCheck() ? ( [ - + ,