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
+
-
-
+ }
+ {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}
- {/*
+
+ {getItemsByCafeId(shopId) < 1 ?
+
+
+
Tidak ada item di keranjang
+
+ :
+ <>
+
+ {cartItems.map((itemType) => (
+
+ ))}
+
+ {table.tableNo != null && (
+
+ Diantar ke {table.tableNo}
+ {/* */}
-
- )}
- {orderType === "serve" && table.length < 1 && (
-
- Serve to:
-
-
- )}
-
-
- Catatan :
-
-
-
-
-
-
-
-
-
- Pembayaran
-
-
-
-
-
-
-
-
-
- >
-}
+ {orderType === "serve" && table.length < 1 && (
+
+ Serve to:
+
+
+ )}
+
+
+ Catatan :
+
+
+
+
+
+
+
+
+
+ Pembayaran
+
+
+
+
+
+
+
+
Kembali
+
+
+ >
+ }
);
}
diff --git a/src/pages/Invoice.module.css b/src/pages/Invoice.module.css
index 57f8cb1..053cdf8 100644
--- a/src/pages/Invoice.module.css
+++ b/src/pages/Invoice.module.css
@@ -42,7 +42,7 @@
border-radius: 15px 15px 0 0;
position: fixed;
- bottom: 75px;
+ bottom: 0;
right: 0;
left: 0;
}
@@ -58,7 +58,7 @@
color: rgba(88, 55, 50, 1);
position: relative;
- height: 180px;
+ height: 220px;
}
.TotalContainer {
@@ -173,7 +173,7 @@
border-radius: 20px;
margin: 0 auto;
padding: 10px;
- font-size: 1.2em;
+ font-size: 15px;
border: 1px solid rgba(88, 55, 50, 0.5);
resize: none; /* Prevent resizing */
overflow-wrap: break-word; /* Ensure text wraps */
diff --git a/src/pages/MaterialList.module.css b/src/pages/MaterialList.module.css
index 87f5196..b5473e0 100644
--- a/src/pages/MaterialList.module.css
+++ b/src/pages/MaterialList.module.css
@@ -51,6 +51,11 @@
justify-content: space-between;
}
+ .resultMessage input {
+ padding-left: 8px;
+ width: 180px;
+ }
+
.stokContainer {
display: flex;
justify-content: space-evenly;
diff --git a/src/pages/Reports.js b/src/pages/Reports.js
index b25858c..055d270 100644
--- a/src/pages/Reports.js
+++ b/src/pages/Reports.js
@@ -472,7 +472,7 @@ const App = ({ forCafe = true, cafeId = -1,
}}
>
- {forCafe &&
}
+ {forCafe &&
}