This commit is contained in:
zadit
2025-01-18 07:42:39 +07:00
parent b111195491
commit 6b95656c4d
12 changed files with 548 additions and 44 deletions

View File

@@ -24,6 +24,7 @@ import { unsubscribeUser } from "../helpers/subscribeHelpers.js";
import WelcomePage from "./WelcomePage.js";
function CafePage({
shopId,
table,
sendParam,
welcomePageConfig,
@@ -44,9 +45,9 @@ function CafePage({
const location = useLocation();
const [searchParams] = useSearchParams();
const token = searchParams.get("token");
const { shopId, tableCode } = useParams();
sendParam({ shopId, tableCode });
const { shopIdentifier, tableCode } = useParams();
sendParam({ shopIdentifier, tableCode });
const navigate = useNavigate();
const [screenMessage, setScreenMessage] = useState("");

View File

@@ -13,9 +13,9 @@ import {
import { getItemsByCafeId } from "../helpers/cartHelpers.js";
export default function Invoice({ table, sendParam, deviceType, socket }) {
const { shopId, tableCode } = useParams();
sendParam({ shopId, tableCode });
export default function Invoice({ shopId, table, sendParam, deviceType, socket }) {
const { shopIdentifier, tableCode } = useParams();
sendParam({ shopIdentifier, tableCode });
const [cartItems, setCartItems] = useState([]);
const [totalPrice, setTotalPrice] = useState(0);

View File

@@ -11,9 +11,9 @@ import {
handlePaymentFromGuestDevice,
} from "../helpers/transactionHelpers";
export default function Invoice({ table, sendParam, deviceType, socket }) {
const { shopId, tableCode } = useParams();
sendParam({ shopId, tableCode });
export default function Invoice({ shopId, table, sendParam, deviceType, socket }) {
const { shopIdentifier, tableCode } = useParams();
sendParam({ shopIdentifier, tableCode });
const location = useLocation(); // Use useLocation hook instead of useSearchParams
const searchParams = new URLSearchParams(location.search); // Pass location.search directly

View File

@@ -176,7 +176,7 @@ export default function Transactions({
transaction.Table ? transaction.Table.tableNo : "N/A"
}`}
</h2>
{(transaction.notes !== "" || isPaymentOpen) && (
{(transaction.notes !== "") && (
<>
<div
className={styles.NoteContainer}
@@ -233,9 +233,7 @@ export default function Transactions({
</ButtonWithReplica>
</div>
<h5
className={`${styles.DeclineButton} ${
isPaymentOpen ? styles.active : ""
}`}
className={`${styles.DeclineButton}`}
onClick={() =>
isPaymentOpen
? setIsPaymentOpen(false)

View File

@@ -11,9 +11,9 @@ import {
import { getTables } from "../helpers/tableHelper";
import TableCanvas from "../components/TableCanvas";
export default function Transactions({ propsShopId, sendParam, deviceType }) {
const { shopId, tableId } = useParams();
if (sendParam) sendParam({ shopId, tableId });
export default function Transactions({ shopId, propsShopId, sendParam, deviceType }) {
const { shopIdentifier, tableId } = useParams();
if (sendParam) sendParam({ shopIdentifier, tableId });
const [tables, setTables] = useState([]);
const [selectedTable, setSelectedTable] = useState(null);

View File

@@ -98,6 +98,8 @@
}
.DeclineButton {
font-family: "Plus Jakarta Sans", sans-serif;
z-index: 201;
position: relative;
font-weight: 500;
font-style: normal;
font-size: 15px;