This commit is contained in:
everythingonblack
2025-05-07 09:14:55 +07:00
parent 97f1fd7bfc
commit 92280ffdd3
6 changed files with 40 additions and 36 deletions

View File

@@ -76,6 +76,7 @@
transition: all 0.5s ease-in-out;
}
.bussinessName h2 {
font-size: 18px;
overflow-wrap: break-word;
color: inherit; /* Ensures that it inherits the color from the parent */
}

View File

@@ -108,7 +108,7 @@ export function MusicPlayer({ socket, shopId, user, shopOwnerId, isSpotifyNeedLo
// setSubtitleColor("white");
// setSubtitleBG("black");
// }
const proxiedUrl = `https://dev.api.kedaimaster.com/image?url=${encodeURIComponent(modifyUrl(imageUrl))}`; // Use your proxy to fetch the image
const proxiedUrl = `https://api.kedaimaster.com/image?url=${encodeURIComponent(modifyUrl(imageUrl))}`; // Use your proxy to fetch the image
setBackgroundImage(proxiedUrl);
} catch (error) {

View File

@@ -14,6 +14,7 @@ const SetPaymentQr = ({ shopId,
const [qrPosition, setQrPosition] = useState([50, 50]);
const [qrSize, setQrSize] = useState(50);
const [qrPayment, setQrPayment] = useState();
const [qrPaymentFile, setQrPaymentFile] = useState();
const [qrCodeDetected, setQrCodeDetected] = useState(false);
const [isNeedConfirmationState, setIsNeedConfirmationState] = useState(0);
const [isQRISavailable, setIsQRISavailable] = useState(0);
@@ -57,6 +58,7 @@ const SetPaymentQr = ({ shopId,
if (file) {
const newqrPayment = URL.createObjectURL(file);
setQrPayment(newqrPayment);
setQrPaymentFile(file);
}
};
@@ -83,13 +85,14 @@ const SetPaymentQr = ({ shopId,
// Save cafe details
const handleSave = async () => {
let qrPaymentFile;
if(qrPaymentInputRef?.current?.files[0])
qrPaymentFile = qrPaymentInputRef.current.files[0];
let qrPaymentFileCache;
if(qrPaymentFile != null)
qrPaymentFileCache = qrPaymentFile;
const details = {
qrPosition,
qrSize,
qrPaymentFile,
qrPaymentFile: qrPaymentFileCache,
isQRISavailable: isQRISavailable === 1,
isOpenBillAvailable: isOpenBillAvailable === 1,
isNeedConfirmationState: isNeedConfirmationState === 1

View File

@@ -1,5 +1,5 @@
// 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;

View File

@@ -190,12 +190,12 @@ export default function Transactions({
</li>
))}
</ul>
{transaction.payment_type != 'paylater/cash' && transaction.payment_type != 'paylater/cashless' &&
<div
onClick={() => {
localStorage.setItem('lastTransaction', JSON.stringify(transaction));
}} className={styles["addNewItem"]}>Tambah pesanan</div>
<div
onClick={() => {
localStorage.setItem('lastTransaction', JSON.stringify(transaction));
}} className={styles["addNewItem"]}>Tambah pesanan</div>
}
<h2 className={styles["Transactions-detail"]}>
@@ -269,28 +269,28 @@ export default function Transactions({
</ButtonWithReplica>
}
</div>
{transaction.payment_type == 'cash' ?
<button
className={styles.PayButton}
onClick={() => handleDecline(transaction.transactionId)}
disabled={
transaction.confirmed === -1 ||
transaction.confirmed === 3 ||
isPaymentLoading
} // Disable button if confirmed (1) or declined (-1) or
>
{isPaymentLoading ? (
<ColorRing height="50" width="50" color="white" />
) : transaction.confirmed === -1 ? (
"Ditolak" // Display "Declined" if the transaction is declined (-1)
) : transaction.confirmed === -2 ? (
"Dibatalkan" // Display "Declined" if the transaction is declined (-1)
) : (
"Batalkan" // Display "Confirm availability" if the transaction is not confirmed (0)
)}
</button>
:
(transaction.payment_type != 'paylater/cash' && transaction.payment_type != 'paylater/cashless' || isPaymentOpen &&
{transaction.payment_type == 'cash' ?
<button
className={styles.PayButton}
onClick={() => handleDecline(transaction.transactionId)}
disabled={
transaction.confirmed === -1 ||
transaction.confirmed === 3 ||
isPaymentLoading
} // Disable button if confirmed (1) or declined (-1) or
>
{isPaymentLoading ? (
<ColorRing height="50" width="50" color="white" />
) : transaction.confirmed === -1 ? (
"Ditolak" // Display "Declined" if the transaction is declined (-1)
) : transaction.confirmed === -2 ? (
"Dibatalkan" // Display "Declined" if the transaction is declined (-1)
) : (
"Batalkan" // Display "Confirm availability" if the transaction is not confirmed (0)
)}
</button>
:
((transaction.payment_type != 'paylater/cash' && transaction.payment_type != 'paylater/cashless' || isPaymentOpen) &&
<h5
className={`${styles.DeclineButton}`}
onClick={() =>
@@ -301,8 +301,8 @@ export default function Transactions({
>
{isPaymentOpen ? "kembali" : "batalkan"}
</h5>
)
}
)
}
</>
: