diff --git a/src/components/Item.js b/src/components/Item.js index 47579d5..6d828e7 100644 --- a/src/components/Item.js +++ b/src/components/Item.js @@ -90,7 +90,7 @@ const Item = ({ }; return ( -
+
{!forInvoice && ( //
@@ -143,13 +143,14 @@ const Item = ({ /> */}

{itemName}

diff --git a/src/components/Item.module.css b/src/components/Item.module.css index 85ff8b3..27c3b29 100644 --- a/src/components/Item.module.css +++ b/src/components/Item.module.css @@ -52,6 +52,7 @@ position: relative; width: 26vw; height: 26vw; + border-radius: 12px; } .overlay { @@ -208,9 +209,12 @@ } .plusNegative2 { - width: 100px; - height: 35px; + width: 84px; + height: 21px; + position: absolute; transform: rotate(45deg); + left: -33px; + top: 21px; } .remove { width: 25px; diff --git a/src/components/MusicPlayer.css b/src/components/MusicPlayer.css index 17b53ed..8ad26cd 100644 --- a/src/components/MusicPlayer.css +++ b/src/components/MusicPlayer.css @@ -25,7 +25,7 @@ /* filter: blur(1.5px); -webkit-filter: blur(1.5px); */ /* border-radius: 13px 13px 0 0; */ - background-color: #6ec35a; + background-color: rgb(95 121 89); /* Rounded corners at the top */ text-align: right; text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7); diff --git a/src/components/TablesPage.js b/src/components/TablesPage.js index 55fe989..f6cf73e 100644 --- a/src/components/TablesPage.js +++ b/src/components/TablesPage.js @@ -609,64 +609,59 @@ const SetPaymentQr = ({ shop }) => { - {!isconfigcafeidentityname ?
{ setIsConfigCafeIdentityName(true); cafeIdentifyNameRef.current && cafeIdentifyNameRef.current.focus() }} // Open the config modal - style={{ - backgroundColor: '#303034', - right: 0, - color: 'white', - borderRadius: '0 0 6px 6px', - fontFamily: 'Roboto', - fontSize: '13px', - padding: 3, - cursor: 'pointer', - marginBottom: '10px' - }} - > - Ganti alamat kedai -
: ( -
-
setIsConfigCafeIdentityName(false)} // Close the config modal - style={{ - backgroundColor: '#303034', - width: '47%', - color: 'white', - borderRadius: '0 0 0px 6px', - fontFamily: 'Roboto', - fontSize: '13px', - padding: 3, - cursor: 'pointer', - }} - > - Batalkan + {!isconfigcafeidentityname ? + <> +
+

Klik untuk ganti alamat

- -
{ - setCafeIdentifyNameDefault(cafeIdentifyNameUpdate) - // Handle save functionality here - setIsConfigCafeIdentityName(false); // Close after saving - - }} - style={{ - backgroundColor: '#303034', - width: '47%', - color: 'white', - borderRadius: '0 0 6px 0px', - fontFamily: 'Roboto', - fontSize: '13px', - padding: 3, - cursor: 'pointer', - }} - > - Simpan +
+

{ setIsConfigCafeIdentityName(true); cafeIdentifyNameRef.current && cafeIdentifyNameRef.current.focus() }}>-----------------

+
{setIsConfigCafeIdentityName(true); cafeIdentifyNameRef.current && cafeIdentifyNameRef.current.focus()}} style={styles.changeButton}>Ganti
-
- )} + : ( +
+
setIsConfigCafeIdentityName(false)} // Close the config modal + style={{ + backgroundColor: '#303034', + width: '47%', + color: 'white', + borderRadius: '0 0 0px 6px', + fontFamily: 'Roboto', + fontSize: '13px', + padding: 3, + cursor: 'pointer', + }} + > + Batalkan +
+ +
{ + setCafeIdentifyNameDefault(cafeIdentifyNameUpdate) + // Handle save functionality here + setIsConfigCafeIdentityName(false); // Close after saving + + }} + style={{ + backgroundColor: '#303034', + width: '47%', + color: 'white', + borderRadius: '0 0 6px 0px', + fontFamily: 'Roboto', + fontSize: '13px', + padding: 3, + cursor: 'pointer', + }} + > + Simpan +
+
+ )}
))} - { } - {cartItemsLength > 0 && + {(user.username || cartItemsLength > 0) &&
- -
-
{cartItemsLength} item
-
- Rp{totalPrice} -
- - - + {cartItemsLength > 0 && +
+
{cartItemsLength} item
+
+ Rp{totalPrice} +
+ + + +
-
- + } + {user.username && +
0 ? '6px' : '0px' }}> +
+
+ + + + + + +
+
+
+ }
}
diff --git a/src/pages/Cart.js b/src/pages/Cart.js index 17f5277..0d10853 100644 --- a/src/pages/Cart.js +++ b/src/pages/Cart.js @@ -13,10 +13,19 @@ import { import { getItemsByCafeId } from "../helpers/cartHelpers.js"; + +import { useNavigationHelpers } from "../helpers/navigationHelpers"; + + export default function Invoice({ shopId, table, sendParam, deviceType, socket }) { const { shopIdentifier, tableCode } = useParams(); + sendParam({ shopIdentifier, tableCode }); + const { + goToShop + } = useNavigationHelpers(shopIdentifier, table.tableCode); + const [cartItems, setCartItems] = useState([]); const [totalPrice, setTotalPrice] = useState(0); const [isPaymentLoading, setIsPaymentLoading] = useState(false); // State for payment button loading animation @@ -144,7 +153,7 @@ export default function Invoice({ shopId, table, sendParam, deviceType, socket } console.log(localStorage.getItem('cart')) console.log(cartItems) - if(localStorage.getItem('cart') == "[]") return; + if (localStorage.getItem('cart') == "[]") return; // Parse the local storage cart const localStorageCart = JSON.parse(localStorage.getItem('cart')); @@ -154,8 +163,8 @@ export default function Invoice({ shopId, table, sendParam, deviceType, socket } // Filter out items from cartItems that do not exist in the local storage cart const updatedCartItems = cartItems.map(itemType => ({ - ...itemType, - itemList: itemType.itemList.filter(item => localStorageItemIds.has(item.itemId)) + ...itemType, + itemList: itemType.itemList.filter(item => localStorageItemIds.has(item.itemId)) })); setCartItems(updatedCartItems); @@ -189,39 +198,39 @@ export default function Invoice({ shopId, table, sendParam, deviceType, socket } setEmail(event.target.value); }; return ( -
0 ? '': '100vh'), minHeight: (getItemsByCafeId(shopId).length > 0 ? 'calc(100vh - 210px)': '') }}> - -
-

Keranjang

- {getItemsByCafeId(shopId) < 1 ? -
-
- - - -
-

Tidak ada item di keranjang

-
- : - <> -
- {cartItems.map((itemType) => ( - - ))} +
0 ? '' : '100vh'), minHeight: (getItemsByCafeId(shopId).length > 0 ? '100vh' : '') }}> -{table.tableNo != null && ( -
- Diantar ke {table.tableNo} - {/* Pickup {table == null && } */} -
- )} - {orderType === "serve" && table.length < 1 && ( -
- Serve to: - -
- )} - -
- Catatan : - -
- -
-