From 725bb867bf156cd73a07703396f3c93e4684cbe3 Mon Sep 17 00:00:00 2001 From: insvrgent Date: Fri, 14 Feb 2025 17:43:22 +0700 Subject: [PATCH] ok --- src/App.css | 2 +- src/App.js | 26 +++--- src/components/Item.js | 34 ++++++-- src/components/Item.module.css | 8 +- src/components/ItemLister.js | 6 +- src/components/MusicPlayer.css | 2 +- src/helpers/cartHelpers.js | 7 +- src/pages/CafePage.js | 129 ++++++++++++++++++------------ src/pages/LinktreePage.module.css | 4 +- 9 files changed, 136 insertions(+), 82 deletions(-) diff --git a/src/App.css b/src/App.css index f70efc5..5576ee1 100644 --- a/src/App.css +++ b/src/App.css @@ -8,7 +8,7 @@ body { } .App { - overflow-x: hidden; + /* overflow-x: hidden; */ } .App-logo { diff --git a/src/App.js b/src/App.js index 37de452..a9f209c 100644 --- a/src/App.js +++ b/src/App.js @@ -55,6 +55,7 @@ function App() { const [shopIdentifier, setShopIdentifier] = useState(""); const [table, setTable] = useState([]); const [totalItemsCount, setTotalItemsCount] = useState(0); + const [totalPrice, setTotalPrice] = useState(0); const [deviceType, setDeviceType] = useState(""); const [shop, setShop] = useState([]); const [shopItems, setShopItems] = useState([]); @@ -78,8 +79,9 @@ function App() { useEffect(() => { const calculateTotalsFromLocalStorage = () => { - const { totalCount } = calculateTotals(shopId); + const { totalCount, totalPrice } = calculateTotals(shopId); setTotalItemsCount(totalCount); + setTotalPrice(totalPrice); }; calculateTotalsFromLocalStorage(); @@ -563,14 +565,16 @@ function App() { setModal={setModal} // Pass the function to open modal loading={shop.name == null} queue={queue} + cartItemsLength={totalItemsCount} + totalPrice={totalPrice} /> -