This commit is contained in:
zadit
2025-01-16 07:27:07 +07:00
parent 50c07e0db1
commit 3d05102199
6 changed files with 38 additions and 24 deletions

View File

@@ -2,7 +2,7 @@
"name": "groovebrew-mockup", "name": "groovebrew-mockup",
"version": "0.1.0", "version": "0.1.0",
"private": true, "private": true,
"homepage": "https://dev.kedaimaster.com", "homepage": "https://kedaimaster.com",
"dependencies": { "dependencies": {
"@emotion/react": "^11.13.3", "@emotion/react": "^11.13.3",
"@emotion/styled": "^11.13.0", "@emotion/styled": "^11.13.0",

View File

@@ -64,7 +64,7 @@
} }
.bussinessName.active { .bussinessName.active {
top: -700%; top: -1000%;
position: absolute; position: absolute;
color: rgb(0, 0, 0); color: rgb(0, 0, 0);
width: 60vw; width: 60vw;
@@ -90,7 +90,7 @@
.bussinessQR.active { .bussinessQR.active {
position: absolute; position: absolute;
top: -250%; top: -321%;
transform: translate(-50%, -80%); transform: translate(-50%, -80%);
transition: all 0.5s ease-in-out; transition: all 0.5s ease-in-out;

View File

@@ -378,7 +378,7 @@ const Header = ({
Desain kafe Desain kafe
</Child> </Child>
<Child onClick={() => setModal("edit_tables")}> <Child onClick={() => setModal("edit_tables")}>
QR kedai dan meja QR kedai
</Child> </Child>
<Child onClick={() => setModal("payment_option")}> <Child onClick={() => setModal("payment_option")}>
Metode pembayaran Metode pembayaran

View File

@@ -141,6 +141,12 @@ const SetPaymentQr = ({ shop }) => {
if (!node) return; 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; const isTableSelected = selectedTable != null;
toPng(node, { pixelRatio: 2 }) // Adjust pixel ratio for higher resolution toPng(node, { pixelRatio: 2 }) // Adjust pixel ratio for higher resolution
@@ -158,27 +164,35 @@ const SetPaymentQr = ({ shop }) => {
.catch((err) => { .catch((err) => {
console.error('Could not download the image', err); console.error('Could not download the image', err);
}) })
.finally(() => {
// Restore the original background color after the download
node.style.backgroundColor = originalBackgroundColor;
});
} }
return ( return (
<div style={styles.container}> <div style={styles.container}>
<h3 style={styles.title}>QR kedai dan meja</h3> <h3 style={styles.title}>QR kedai</h3>
<div <div
id="qr-code-container" id="qr-code-container"
style={{ style={{
background: `center center / contain no-repeat url(${bgImageUrl})`,
backgroundSize: "contain",
border: "1px solid #ddd",
...styles.qrCodeContainer, ...styles.qrCodeContainer,
backgroundImage: `url(${bgImageUrl})`, backgroundColor: '#cdcdcd'
backgroundPosition: "center",
backgroundRepeat: "no-repeat",
backgroundSize: "contain",
}} }}
> >
<img
src={bgImageUrl}
alt="QR Code"
style={{
position: "absolute",
width: '100%',
height: '100%',
objectFit: 'contain',
transform: "translate(-50%, 0%)",
}} />
<img <img
src={generateQRCodeUrl(selectedTable?.tableCode || null)} src={generateQRCodeUrl(selectedTable?.tableCode || null)}
alt="QR Code" alt="QR Code"
@@ -221,16 +235,16 @@ const SetPaymentQr = ({ shop }) => {
<p>Klik untuk ganti background</p> <p>Klik untuk ganti background</p>
</div> </div>
<div style={styles.resultMessage}> <div style={styles.resultMessage}>
<p onClick={() => {setIsConfig(!isConfig); setIsConfigQR(false); setIsConfigFont(false)}}> {isConfig ? '˅' : '˃'} Konfigurasi</p> <p onClick={() => {setIsConfig(!isConfig); setIsConfigQR(!isConfigQR); setIsConfigFont(false)}}> {isConfig ? '˅' : '˃'} Konfigurasi QR</p>
<div <div
onClick={() => qrBackgroundInputRef.current.click()} style={styles.changeButton}>Ganti</div> onClick={() => qrBackgroundInputRef.current.click()} style={styles.changeButton}>Ganti</div>
</div> </div>
<div style={styles.switchContainer}> <div style={styles.switchContainer}>
{isConfig && {isConfig &&
<div style={{ marginLeft: '15px' }}> <div style={{ marginLeft: '15px' }}>
<p style={styles.description} onClick={() => { setIsConfigQR(!isConfigQR); setIsConfigFont(false) }}> {/* <p style={styles.description} onClick={() => { setIsConfigQR(!isConfigQR); setIsConfigFont(false) }}>
{isConfigQR ? '˅' : '˃'} Konfigurasi QR {isConfigQR ? '˅' : '˃'} Konfigurasi QR
</p> </p> */}
{isConfigQR && <> {isConfigQR && <>
<div style={styles.sliderContainer}> <div style={styles.sliderContainer}>
<label style={styles.label}> <label style={styles.label}>
@@ -290,9 +304,9 @@ const SetPaymentQr = ({ shop }) => {
</div> </div>
</>} </>}
<p style={styles.description} onClick={() => { setIsConfigFont(!isConfigFont); setIsConfigQR(false) }}> {/* <p style={styles.description} onClick={() => { setIsConfigFont(!isConfigFont); setIsConfigQR(false) }}>
{isConfigFont ? '˅' : '˃'} Konfigurasi nomor {isConfigFont ? '˅' : '˃'} Konfigurasi nomor
</p> </p> */}
{isConfigFont && ( {isConfigFont && (
<> <>
<div style={styles.sliderContainer}> <div style={styles.sliderContainer}>
@@ -371,9 +385,9 @@ const SetPaymentQr = ({ shop }) => {
</div> </div>
} }
<p style={styles.description} onClick={() => setIsViewTables(!isViewTables)}> {/* <p style={styles.description} onClick={() => setIsViewTables(!isViewTables)}>
{isViewTables ? '˅' : '˃'} Daftar meja {isViewTables ? '˅' : '˃'} Daftar meja
</p> </p> */}
{isViewTables && {isViewTables &&
<div style={{marginTop: '34px', marginLeft: '15px'}}> <div style={{marginTop: '34px', marginLeft: '15px'}}>
@@ -421,7 +435,8 @@ const SetPaymentQr = ({ shop }) => {
</> : </> :
<> <>
<div style={styles.uploadMessage}> <div style={styles.uploadMessage}>
<p>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.'}</p> <p>Ini adalah QR yang dapat di scan oleh tamu untuk memesan </p>
{/* <p>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.'}</p> */}
</div> </div>
<div style={styles.buttonContainer}> <div style={styles.buttonContainer}>
<button onClick={()=>downloadQrCodeContainer({selectedTable, shop})} style={styles.saveButton}> <button onClick={()=>downloadQrCodeContainer({selectedTable, shop})} style={styles.saveButton}>

View File

@@ -1,5 +1,5 @@
// src/config.js // src/config.js
const API_BASE_URL = 'https://dev.api.kedaimaster.com'; const API_BASE_URL = 'https://api.kedaimaster.com';
export default API_BASE_URL; export default API_BASE_URL;

View File

@@ -132,7 +132,6 @@ export default function Transactions({
onClick={() => onClick={() =>
setSelectedTable(transaction.Table || { tableId: 0 }) setSelectedTable(transaction.Table || { tableId: 0 })
} }
style={{ overflow: "hidden" }}
> >
<div className={styles['receipt-header']}> <div className={styles['receipt-header']}>