setModal("payment_option")}>
Metode pembayaran
diff --git a/src/components/TablesPage.js b/src/components/TablesPage.js
index b1b2e03..f077969 100644
--- a/src/components/TablesPage.js
+++ b/src/components/TablesPage.js
@@ -28,7 +28,14 @@ const SetPaymentQr = ({ shop }) => {
const [initialSize, setInitialSize] = useState(shop.scale);
const [bgImageUrl, setBgImageUrl] = useState(getImageUrl(shop.qrBackground));
const qrBackgroundInputRef = useRef(null);
- const shopUrl = window.location.hostname + "/" + shop.cafeId;
+
+ const [cafeIdentifyNameUpdate, setCafeIdentifyNameUpdate] = useState(shop.cafeIdentifyName);
+ const shopUrl = window.location.hostname + "/" + cafeIdentifyNameUpdate;
+
+
+ const cafeIdentifyNameRef = useRef(null);
+ const [isconfigcafeidentityname, setIsConfigCafeIdentityName] = useState(false);
+
const generateQRCodeUrl = (tableCode) => {
if (tableCode != null) {
@@ -124,41 +131,41 @@ const SetPaymentQr = ({ shop }) => {
const handleCreate = async () => {
// if (newTable) {
- try {
- const createdTable = await createTable(shop.cafeId, {
- // ...newTable,
- tableNo,
- });
- setTables([...tables, createdTable]);
- setTableNo("");
- } catch (error) {
- console.error("Error creating table:", error);
- }
+ try {
+ const createdTable = await createTable(shop.cafeId, {
+ // ...newTable,
+ tableNo,
+ });
+ setTables([...tables, createdTable]);
+ setTableNo("");
+ } catch (error) {
+ console.error("Error creating table:", error);
+ }
};
function downloadQrCodeContainer({ selectedTable, shop }) {
const node = document.getElementById('qr-code-container');
-
+
if (!node) return;
-
+
// Save the original background color
const originalBackgroundColor = node.style.backgroundColor;
-
+
// Temporarily remove the background color
node.style.backgroundColor = 'transparent';
-
+
const isTableSelected = selectedTable != null;
-
+
toPng(node, { pixelRatio: 2 }) // Adjust pixel ratio for higher resolution
.then((dataUrl) => {
const link = document.createElement('a');
link.href = dataUrl;
-
+
// Set the file name based on whether selectedTable exists
- link.download = isTableSelected
- ? `QR Meja (${selectedTable.tableNo}).png`
+ link.download = isTableSelected
+ ? `QR Meja (${selectedTable.tableNo}).png`
: `QR ${shop.name}.png`;
-
+
link.click();
})
.catch((err) => {
@@ -169,14 +176,13 @@ const SetPaymentQr = ({ shop }) => {
node.style.backgroundColor = originalBackgroundColor;
});
}
-
-
-
+
+
+
return (
-
QR kedai
-
-
+
Identifikasi kedai
+
{
{
{
wordWrap: 'break-word',
}}
>
- kedaimaster.com/
+ {window.location.hostname}/
-
- galauers
-
+ onChange={(e)=>setCafeIdentifyNameUpdate(e.target.value)}
+ value={cafeIdentifyNameUpdate}
+ onFocus={() => {
+ setIsConfigCafeIdentityName(true); // Set the state to true when input is focused
+ }}
+ onBlur={() => {
+ setIsConfigCafeIdentityName(false); // Set the state to false when input loses focus
+ setCafeIdentifyNameUpdate(shop.cafeIdentifyName)
+ }} // Handle blur event to reset the state
+ />
{
position: 'absolute',
}}
>
-
+
+
+
{
position: 'absolute',
}}
>
-
-
-
-
{
top: 0,
position: 'absolute',
}}
- >
-
+ >
+
+
{
position: 'absolute',
}}
>
-
+
+
+
@@ -532,7 +495,7 @@ const SetPaymentQr = ({ shop }) => {
>
{
>
@@ -650,6 +598,62 @@ 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
+
+
+
{
+ // 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
+
+
+ )}
{
backgroundColor: '#cdcdcd'
}}
>
-
+
{
/>
{!isViewingQR ?
- <>
-
-
Klik untuk ganti background
-
-
-
{setIsConfig(!isConfig); setIsConfigQR(!isConfigQR); setIsConfigFont(false)}}> {isConfig ? '˅' : '˃'} Konfigurasi QR
-
qrBackgroundInputRef.current.click()} style={styles.changeButton}>Ganti
-
-
- {isConfig &&
-
- {/*
{ setIsConfigQR(!isConfigQR); setIsConfigFont(false) }}>
+ <>
+
+
Klik untuk ganti background
+
+
+
{ setIsConfig(!isConfig); setIsConfigQR(!isConfigQR); setIsConfigFont(false) }}> {isConfig ? '˅' : '˃'} Konfigurasi QR
+
qrBackgroundInputRef.current.click()} style={styles.changeButton}>Ganti
+
+
+ {isConfig &&
+
+ {/*
{ setIsConfigQR(!isConfigQR); setIsConfigFont(false) }}>
{isConfigQR ? '˅' : '˃'} Konfigurasi QR
*/}
- {isConfigQR && <>
-
-
- QR Code Size:
-
-
10%
-
-
{initialSize}%
+ {isConfigQR && <>
+
-
-
-
-
- QR Code Position X:
-
-
0%
-
-
{initialPos.left}%
+
-
-
-
-
- QR Code Position Y:
-
-
0%
-
-
{initialPos.top}%
+
-
-
- >}
+ >}
- {/* { setIsConfigFont(!isConfigFont); setIsConfigQR(false) }}>
+ {/*
{ setIsConfigFont(!isConfigFont); setIsConfigQR(false) }}>
{isConfigFont ? '˅' : '˃'} Konfigurasi nomor
*/}
- {isConfigFont && (
- <>
-
-
- Ukuran nomor meja:
-
-
10%
-
-
{fontsize}%
+ {isConfigFont && (
+ <>
+
-
-
-
-
- Posisi nomor meja - horizontal:
-
-
0%
-
-
{initialFontPos.left}%
+
-
-
-
-
- Posisi nomor meja - vertikal:
-
-
0%
-
-
{initialFontPos.top}%
+
-
-
-
-
- Warna nomor meja:
-
-
setfontcolor(e.target.value)} // Update the font color state
- style={styles.colorInput} // Add your styles for the color input if needed
- />
-
{fontcolor} {/* Display the selected color value */}
+
-
-
- >
- )}
+ >
+ )}
-
- }
- {/* setIsViewTables(!isViewTables)}>
+
+ }
+ {/* setIsViewTables(!isViewTables)}>
{isViewTables ? '˅' : '˃'} Daftar meja
*/}
- {isViewTables &&
-
-
-
setTableNo(e.target.value)} value={tableNo}/>
-
Buat meja
-
- {tables && tables
- .filter((table) => table.tableNo !== 0)
- .map((table) => (
-
setSelectedTable(selectedTable == table ? null : table)}
- >
-
- {table.tableNo}
-
-
- ))
+ {isViewTables &&
+
+
+
setTableNo(e.target.value)} value={tableNo} />
+
Buat meja
+
+ {tables && tables
+ .filter((table) => table.tableNo !== 0)
+ .map((table) => (
+
setSelectedTable(selectedTable == table ? null : table)}
+ >
+
+ {table.tableNo}
+
+
+ ))
+ }
+
}
- }
-
-
-
- Simpan
-
- setIsViewingQR(true)} style={styles.saveButton}>
- Download QR {selectedTable? 'meja' : 'kedai'}
-
-
- > :
- <>
-
-
Ini adalah QR yang dapat di scan oleh tamu untuk memesan
- {/*
QR ini akan menjadi identifikasi bahwa pelanggan memesan dari {selectedTable? `(${selectedTable?.tableNo})` : 'link kafe ini. Untuk mengantarkan pelanggan ke meja yang teridentifikasi, anda perlu membuat meja.'}
*/}
-
-
- downloadQrCodeContainer({selectedTable, shop})} style={styles.saveButton}>
- Download QR {selectedTable? 'meja' : 'kedai'}
-
-
-
-
setIsViewingQR(false)} >
- Kembali
-
-
- >
+
+
+ Simpan
+
+ setIsViewingQR(true)} style={styles.saveButton}>
+ Download QR {selectedTable ? 'meja' : 'kedai'}
+
+
+ > :
+ <>
+
+
Ini adalah QR yang dapat di scan oleh tamu untuk memesan
+ {/*
QR ini akan menjadi identifikasi bahwa pelanggan memesan dari {selectedTable? `(${selectedTable?.tableNo})` : 'link kafe ini. Untuk mengantarkan pelanggan ke meja yang teridentifikasi, anda perlu membuat meja.'}
*/}
+
+
+ downloadQrCodeContainer({ selectedTable, shop })} style={styles.saveButton}>
+ Download QR {selectedTable ? 'meja' : 'kedai'}
+
+
+
+
setIsViewingQR(false)} >
+ Kembali
+
+
+ >
}
);
diff --git a/src/pages/Dashboard.js b/src/pages/Dashboard.js
index 567de89..33a4f35 100644
--- a/src/pages/Dashboard.js
+++ b/src/pages/Dashboard.js
@@ -678,7 +678,7 @@ const sortedMaterials = allMaterials.sort((a, b) => new Date(a.date) - new Date(
-
cafe.cafeId == selectedSubItemId)?.cafeId) == null ? 'hidden' : 'visible' }} onClick={() => window.location.href = window.location.origin + '/' + (selectedItems?.cafeId || selectedSubItems.find(cafe => cafe.cafeId == selectedSubItemId)?.cafeId)}>Kunjungi kedai
+
cafe.cafeId == selectedSubItemId)?.cafeId) == null ? 'hidden' : 'visible' }} onClick={() => window.location.href = window.location.origin + '/' + (selectedItems?.cafeIdentifyName || selectedSubItems.find(cafe => cafe.cafeId == selectedSubItemId)?.cafeIdentifyName)}>Kunjungi kedai
terlaku
-
-
Aktifkan Notifikasi
-
+
+
+
Notifikasi tidak aktif
- Sepertinya notifikasi untuk situs ini tidak aktif. Aktifkan notifikasi supaya kamu tetap dapat info pesanan, meski sedang buka aplikasi lain.
+ Aktifkan notifikasi supaya kamu tetap dapat info pesanan, meski sedang buka aplikasi lain.
Aktifkan