From e4ff36f231755abcc60085ae7a1646b27e70e70f Mon Sep 17 00:00:00 2001 From: yunseok Date: Wed, 31 Jul 2024 19:21:00 +0900 Subject: [PATCH 01/17] =?UTF-8?q?feat:=20=EC=A3=BC=EB=AC=B8=EB=82=B4?= =?UTF-8?q?=EC=97=AD=20=EC=99=84=EB=A3=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Home/HotMarket.js | 1 + src/components/Home/LatestMarket.js | 1 + src/components/Home/NearbyMarket.js | 4 +- src/components/OrderList/OrderItem.js | 84 +++++++++++++++++++++++++++ src/pages/OrderListPage.js | 22 +++---- 5 files changed, 99 insertions(+), 13 deletions(-) create mode 100644 src/components/OrderList/OrderItem.js diff --git a/src/components/Home/HotMarket.js b/src/components/Home/HotMarket.js index 35b2556..cff7521 100644 --- a/src/components/Home/HotMarket.js +++ b/src/components/Home/HotMarket.js @@ -31,6 +31,7 @@ const HotMarket = ({ market }) => { export default HotMarket; const Wrapper = styled.div` + cursor: pointer; .market-image { width: 218px; height: 162px; diff --git a/src/components/Home/LatestMarket.js b/src/components/Home/LatestMarket.js index 6eba52c..dfa881d 100644 --- a/src/components/Home/LatestMarket.js +++ b/src/components/Home/LatestMarket.js @@ -65,4 +65,5 @@ const Wrapper = styled.div` } margin-bottom: 10px; } + cursor: pointer; `; diff --git a/src/components/Home/NearbyMarket.js b/src/components/Home/NearbyMarket.js index 08ac39a..c947eff 100644 --- a/src/components/Home/NearbyMarket.js +++ b/src/components/Home/NearbyMarket.js @@ -35,12 +35,12 @@ const NearbyMarket = ({ username }) => { if (location) { getLocation(); } - }, [location]); + }, [location, getLocation]); return ( - {username}님과 + {username ? username : "시럽"}님과
지금 가까운 시장은?
diff --git a/src/components/OrderList/OrderItem.js b/src/components/OrderList/OrderItem.js new file mode 100644 index 0000000..472611c --- /dev/null +++ b/src/components/OrderList/OrderItem.js @@ -0,0 +1,84 @@ +import { useNavigate } from "react-router-dom"; +import styled from "styled-components"; + +const OrderItem = () => { + const navigate = useNavigate(); + return ( + { + navigate("/order/1"); + }} + > +
+
+ 광장시장 + 2022.05.24 오후 8:30 +
+
+
+ 진아한복 + 61,000원 +
+ 결제 확인 대기 +
+
+
+ ); +}; + +export default OrderItem; + +const Container = styled.div` + display: flex; + flex-direction: column; + width: 100%; + padding-top: 20px; + background-color: white; + cursor: pointer; + + .order-header { + padding: 0 20px; + display: flex; + justify-content: space-between; + .title-text { + font-size: 16px; + color: ${({ theme }) => theme.color.gray900}; + font-weight: ${({ theme }) => theme.fontWeight.bold}; + } + .main-text { + font-size: 14px; + color: ${({ theme }) => theme.color.gray600}; + font-weight: ${({ theme }) => theme.fontWeight.medium}; + } + padding-bottom: 20px; + border-bottom: 1px solid ${({ theme }) => theme.color.gray100}; + } + + .order-body { + padding: 0 20px; + display: flex; + justify-content: space-between; + color: ${({ theme }) => theme.color.gray500}; + font-weight: ${({ theme }) => theme.fontWeight.semiBold}; + font-size: 16px; + align-items: center; + margin-top: 16px; + padding-bottom: 20px; + + .left-section { + display: flex; + flex-direction: column; + gap: 8px; + } + + .title-text { + color: ${({ theme }) => theme.color.gray900}; + } + .main-text { + font-size: 14px; + } + .success { + color: ${({ theme }) => theme.color.primary}; + } + } +`; diff --git a/src/pages/OrderListPage.js b/src/pages/OrderListPage.js index b616ce6..44cfce5 100644 --- a/src/pages/OrderListPage.js +++ b/src/pages/OrderListPage.js @@ -3,14 +3,19 @@ import styled from "styled-components"; import { ReactComponent as NoItem } from "assets/images/no-item.svg"; import Button from "components/Common/Button"; import { useNavigate } from "react-router-dom"; +import OrderItem from "components/OrderList/OrderItem"; const OrderListPage = () => { const navigate = useNavigate(); const orderList = null; return orderList === null ? ( - + <>
- + + + + + ) : ( <>
@@ -26,17 +31,12 @@ const OrderListPage = () => { ); }; -const Container = styled.div` +const OrderList = styled.div` display: flex; - min-height: 100dvh; flex-direction: column; - align-items: center; - overflow-y: auto; - &::-webkit-scrollbar { - display: none; - } - -ms-overflow-style: none; // IE 및 Edge - scrollbar-width: none; // Firefox + gap: 6px; + width: 100%; + background-color: ${({ theme }) => theme.color.gray100}; `; const NoItemContainer = styled.div` From ad87f03a4be91c78b2cc9e26b9182a7a0894bb06 Mon Sep 17 00:00:00 2001 From: yunseok Date: Wed, 31 Jul 2024 19:21:32 +0900 Subject: [PATCH 02/17] =?UTF-8?q?fix:=20=EB=A6=AC=EB=B7=B0=20=ED=8E=98?= =?UTF-8?q?=EC=9D=B4=EC=A7=80=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/ReviewPage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/ReviewPage.js b/src/pages/ReviewPage.js index 1262af9..d511567 100644 --- a/src/pages/ReviewPage.js +++ b/src/pages/ReviewPage.js @@ -52,7 +52,7 @@ const ReviewPage = () => { const dto = { menuId: orderId, rate: rating, - content: ratingText, + content: review, }; formData.append( From e54a54d3be00a6e47c959fcbee6abaaf6ce5ac56 Mon Sep 17 00:00:00 2001 From: yunseok Date: Wed, 31 Jul 2024 19:23:22 +0900 Subject: [PATCH 03/17] =?UTF-8?q?fix:=20=EA=B0=80=EA=B9=8C=EC=9A=B4=20?= =?UTF-8?q?=EC=8B=9C=EC=9E=A5=20=ED=94=BD=EC=8A=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Home/NearbyMarket.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Home/NearbyMarket.js b/src/components/Home/NearbyMarket.js index c947eff..c27dc86 100644 --- a/src/components/Home/NearbyMarket.js +++ b/src/components/Home/NearbyMarket.js @@ -35,7 +35,7 @@ const NearbyMarket = ({ username }) => { if (location) { getLocation(); } - }, [location, getLocation]); + }, [location]); return ( From fd3ed0e3b90077344f448e1b2a1ee5c4de886bc7 Mon Sep 17 00:00:00 2001 From: yunseok Date: Wed, 31 Jul 2024 19:25:12 +0900 Subject: [PATCH 04/17] =?UTF-8?q?feat:=20=EC=8A=A4=ED=94=8C=EB=9E=98?= =?UTF-8?q?=EC=8B=9C=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Home/NearbyMarket.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/Home/NearbyMarket.js b/src/components/Home/NearbyMarket.js index c27dc86..06c8bca 100644 --- a/src/components/Home/NearbyMarket.js +++ b/src/components/Home/NearbyMarket.js @@ -16,7 +16,7 @@ const NearbyMarket = ({ username }) => { const navigate = useNavigate(); const syluvAxios = useSyluvAxios(); const { location, error } = useGeoLocation(geolocationOptions); - const [nearMarket, setNearMarket] = useState("..."); + const [nearMarket, setNearMarket] = useState(""); const getLocation = useCallback(() => { syluvAxios @@ -37,6 +37,10 @@ const NearbyMarket = ({ username }) => { } }, [location]); + if (nearMarket === "") { + return ; + } + return ( @@ -46,7 +50,7 @@ const NearbyMarket = ({ username }) => {
navigate(`/market/${nearMarket.marketId}`)} + onClick={() => navigate(`/market/${nearMarket?.marketId}`)} > {nearMarket.marketName} From 4c802471c07464932e25e6b7cc1df45dc45f1cbc Mon Sep 17 00:00:00 2001 From: yunseok Date: Wed, 31 Jul 2024 20:00:45 +0900 Subject: [PATCH 05/17] =?UTF-8?q?feat:=20visitlist=20api=20=EB=B3=80?= =?UTF-8?q?=EB=8F=99=EC=82=AC=ED=95=AD=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Home/NearbyMarket.js | 11 ++++------- src/pages/MarketPage.js | 8 +++++--- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/components/Home/NearbyMarket.js b/src/components/Home/NearbyMarket.js index 06c8bca..5390aa3 100644 --- a/src/components/Home/NearbyMarket.js +++ b/src/components/Home/NearbyMarket.js @@ -4,7 +4,6 @@ import { useNavigate } from "react-router-dom"; import useSyluvAxios from "hooks/useSyluvAxios"; import { useCallback, useEffect, useState } from "react"; import { useGeoLocation } from "hooks/useGeoLocation"; -import Splash from "components/Common/Splash"; const geolocationOptions = { enableHighAccuracy: true, @@ -37,10 +36,6 @@ const NearbyMarket = ({ username }) => { } }, [location]); - if (nearMarket === "") { - return ; - } - return ( @@ -50,10 +45,12 @@ const NearbyMarket = ({ username }) => {
navigate(`/market/${nearMarket?.marketId}`)} + onClick={() => + navigate(`/market/${nearMarket ? nearMarket.marketId : 1}`) + } > - {nearMarket.marketName} + {nearMarket ? nearMarket.marketName : "광장시장"}
); diff --git a/src/pages/MarketPage.js b/src/pages/MarketPage.js index 5491d27..e3e471b 100644 --- a/src/pages/MarketPage.js +++ b/src/pages/MarketPage.js @@ -46,11 +46,13 @@ const MarketPage = () => { useEffect(() => { syluvAxios - .get("/market/visitlist") + .get("/market/visitlist/today") .then((res) => { - setVisitList(res.data.payload); - const num = res.data.payload.length; + const dates = Object.keys(res.data.payload); + setVisitList(res.data.payload[dates[0]]); + const num = res.data.payload[dates[0]].length; setVisitNum(num); + console.log(res.data.payload[dates[0]]); }) .catch((error) => { console.error( From f92c6354b348937a09136c4cfc76671475359cb2 Mon Sep 17 00:00:00 2001 From: yunseok Date: Wed, 31 Jul 2024 21:09:15 +0900 Subject: [PATCH 06/17] =?UTF-8?q?feat:=20=EB=B0=A9=EB=AC=B8=EB=A6=AC?= =?UTF-8?q?=EC=8A=A4=ED=8A=B8=20UI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/index.html | 2 +- src/App.js | 5 + src/components/Visit/TotalVisitItem.js | 166 +++++++++++++++++++++++++ src/components/Visit/TotalVisitList.js | 40 ++++++ src/pages/VisitListPage.js | 46 +++++++ 5 files changed, 258 insertions(+), 1 deletion(-) create mode 100644 src/components/Visit/TotalVisitItem.js create mode 100644 src/components/Visit/TotalVisitList.js create mode 100644 src/pages/VisitListPage.js diff --git a/public/index.html b/public/index.html index 228de28..f761c33 100644 --- a/public/index.html +++ b/public/index.html @@ -7,7 +7,7 @@