ok
This commit is contained in:
@@ -10,6 +10,7 @@ import {
|
||||
|
||||
import "../App.css";
|
||||
|
||||
import API_BASE_URL from '../config';
|
||||
import Watermark from "../components/Watermark";
|
||||
import { getImageUrl, createItem, updateItem, moveItemType } from "../helpers/itemHelper.js";
|
||||
import SearchInput from "../components/SearchInput";
|
||||
@@ -140,7 +141,7 @@ function CafePage({
|
||||
socket.on("joined-room", (response) => {
|
||||
const { isSpotifyNeedLogin, isExceededDeadline } = response;
|
||||
setNeedSpotifyLogin(isSpotifyNeedLogin);
|
||||
if (isExceededDeadline) setModal('message',{returnMessage:'Kafe sedang tidak tersedia'});
|
||||
if (isExceededDeadline) setModal('message',{captMessage:'Kafe sedang tidak tersedia'});
|
||||
setIsExceededDeadline(isExceededDeadline);
|
||||
});
|
||||
}
|
||||
@@ -199,7 +200,7 @@ function CafePage({
|
||||
else
|
||||
return (
|
||||
<>
|
||||
{welcomePageConfig && isStarted ? (
|
||||
{/* {welcomePageConfig && isStarted ? (
|
||||
<WelcomePage
|
||||
image={config.image}
|
||||
welcomingText={config.welcomingText}
|
||||
@@ -209,9 +210,12 @@ function CafePage({
|
||||
onGetStarted={handleGetStarted}
|
||||
isFullscreen={true}
|
||||
/>
|
||||
) : (
|
||||
welcomePageConfig != null && (
|
||||
<div className="Cafe" style={{ display: 'flex', flexDirection: 'column', justifyContent: 'space-between', minHeight: '100vh', filter: isExceededDeadline ? 'grayscale(1)' : '', pointerEvents: isExceededDeadline ? 'none' : '' }}>
|
||||
) : ( */}
|
||||
<div className={`Cafe ${isExceededDeadline ? 'grayscale' : ''}`}>
|
||||
|
||||
{API_BASE_URL != 'https://api.kedaimaster.com' &&
|
||||
<div className="Watermark"></div>
|
||||
}
|
||||
<div className="App-header">
|
||||
<Header
|
||||
HeaderText={"Menu"}
|
||||
@@ -363,8 +367,7 @@ function CafePage({
|
||||
</div>
|
||||
<Watermark/>
|
||||
</div>
|
||||
)
|
||||
)}
|
||||
{/* )} */}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ const CreateCouponPage = () => {
|
||||
let encodedCouponCode = encodeURIComponent(encryptedCouponCode);
|
||||
|
||||
// Construct the URL with the encoded coupon code as a query parameter
|
||||
const urlWithCoupon = `https://dev.coupon.kedaimaster.com/coupon?c=${encodedCouponCode}`;
|
||||
const urlWithCoupon = `https://coupon.kedaimaster.com/coupon?c=${encodedCouponCode}`;
|
||||
|
||||
// Optionally, set the URL to use with the coupon
|
||||
setCouponUrl(urlWithCoupon);
|
||||
|
||||
@@ -35,7 +35,6 @@ const LinktreePage = ({ user, setModal }) => {
|
||||
const [selectedSubItemId, setSelectedSubItemId] = useState(0);
|
||||
const [coupons, setCoupons] = useState(null);
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
const urlParams = new URLSearchParams(location.search);
|
||||
const modalParam = urlParams.get('modal');
|
||||
@@ -126,6 +125,7 @@ const LinktreePage = ({ user, setModal }) => {
|
||||
useEffect(() => {
|
||||
if (user) {
|
||||
setLoading(true);
|
||||
document.body.style.backgroundColor = "white";
|
||||
switch (user.roleId) {
|
||||
case 0:
|
||||
getAnalytics().then(setItems).catch(console.error).finally(() => setLoading(false));
|
||||
@@ -138,6 +138,7 @@ const LinktreePage = ({ user, setModal }) => {
|
||||
break;
|
||||
default:
|
||||
setLoading(false);
|
||||
document.body.style.backgroundColor = "rgb(222, 237, 100)";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -192,11 +192,11 @@ const LinktreePage = ({ data, setModal }) => {
|
||||
|
||||
const loggingcoupon = await handleLogCouponForUser(); // Await the coupon logging process
|
||||
setModal('message', {
|
||||
returnMessage: loggingcoupon ? 'Kupon berhasil ditambahkan' : 'Kupon gagal ditambahkan'
|
||||
captMessage: loggingcoupon ? 'Kupon berhasil ditambahkan' : 'Kupon gagal ditambahkan'
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('Error during coupon handling:', error);
|
||||
setModal('message', { returnMessage: 'Kupon gagal ditambahkan' });
|
||||
setModal('message', { captMessage: 'Kupon gagal ditambahkan' });
|
||||
}
|
||||
}
|
||||
}}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
.dashboardContainer {
|
||||
z-index: 6;
|
||||
padding-top: 40px;
|
||||
padding: 40px 3px 15px 3px;
|
||||
}
|
||||
|
||||
/* Main Heading */
|
||||
@@ -25,7 +25,27 @@
|
||||
letter-spacing: -1px;
|
||||
color: rgb(37, 79, 26);
|
||||
}
|
||||
.button {
|
||||
color: white;
|
||||
background-color: rgb(37, 79, 26);
|
||||
border-radius: 25px;
|
||||
padding: 0px 0px 0px 18px;
|
||||
width: 222px;
|
||||
font-weight: 700;
|
||||
font-size: 32px;
|
||||
line-height: 2.25rem;
|
||||
letter-spacing: -1px;
|
||||
}
|
||||
|
||||
.descHeading {
|
||||
width: 99%;
|
||||
font-weight: 700;
|
||||
font-size: 16px;
|
||||
line-height: 1.25rem;
|
||||
margin-bottom: 1rem;
|
||||
letter-spacing: -1px;
|
||||
color: rgb(37, 79, 26);
|
||||
}
|
||||
/* Main Heading */
|
||||
.voucherHeading {
|
||||
font-weight: 700;
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
z-index: 6;
|
||||
padding: 0 1rem;
|
||||
padding-top: 100px;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
/* Main Heading */
|
||||
|
||||
@@ -2,24 +2,26 @@
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import styles from './Join.module.css'; // Import the module.css file
|
||||
|
||||
const LinktreePage = () => {
|
||||
const [returnMessage, setReturnMessage] = useState('');
|
||||
const LinktreePage = ({ handleYes }) => {
|
||||
const [captMessage, setCaptMessage] = useState('');
|
||||
const [descMessage, setDescMessage] = useState('');
|
||||
|
||||
useEffect(() => {
|
||||
const newQueryParams = new URLSearchParams(window.location.search);
|
||||
const r = newQueryParams.get('returnMessage');
|
||||
const r = newQueryParams.get('captMessage');
|
||||
const s = newQueryParams.get('descMessage');
|
||||
if (r) {
|
||||
setReturnMessage(r)
|
||||
setCaptMessage(r)
|
||||
setDescMessage(s)
|
||||
}
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<div className={styles.linktreePage}>
|
||||
<div className={styles.dashboardContainer}>
|
||||
<div className={styles.mainHeading}>{returnMessage}</div>
|
||||
<div className={styles.subHeadingTransparent}>
|
||||
Daftarkan kedaimu sekarang dan mulai gunakan semua fitur unggulan kami.
|
||||
</div>
|
||||
<div className={styles.mainHeading}>{captMessage}</div>
|
||||
<div className={styles.descHeading}>{descMessage}</div>
|
||||
{handleYes && <div onClick={handleYes} className={styles.button}>Aktifkan</div>}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -452,7 +452,7 @@ const App = ({ forCafe = true, cafeId = -1,
|
||||
setModal('loading');
|
||||
const create = await createCafe(itemName);
|
||||
setModal('message', {
|
||||
returnMessage: create ? 'Berhasil membuat cafe' : 'Gagal membuat cafe'
|
||||
captMessage: create ? 'Berhasil membuat cafe' : 'Gagal membuat cafe'
|
||||
});
|
||||
|
||||
// Add a 2-second delay before proceeding
|
||||
|
||||
Reference in New Issue
Block a user