From 54076352ea53566441c6b13d54fac87264fc2f53 Mon Sep 17 00:00:00 2001 From: Fikri Naufal Hamdi <18221096@std.stei.itb.ac.id> Date: Mon, 27 Nov 2023 21:58:12 +0700 Subject: [PATCH] fix: fix error uncheck merged --- frontend/package.json | 3 - frontend/src/components/ProductCard.tsx | 212 +++++++++++++----------- frontend/src/pages/OrderSummary.tsx | 172 ++++++++++++------- 3 files changed, 226 insertions(+), 161 deletions(-) diff --git a/frontend/package.json b/frontend/package.json index 35fedbd..ba8a98f 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -29,15 +29,12 @@ "react-toastify": "^9.1.3" }, "devDependencies": { -<<<<<<< HEAD "@babel/preset-typescript": "^7.23.3", "@jest/globals": "^29.7.0", "@testing-library/jest-dom": "^6.1.4", "@testing-library/react": "^14.1.2", "@types/jest": "^29.5.10", -======= "@types/crypto-js": "^4.2.1", ->>>>>>> cd14ccc80038e5ec620f4f13cc1d5420599e0ed5 "@types/react": "^18.2.15", "@types/react-dom": "^18.2.7", "@typescript-eslint/eslint-plugin": "^6.0.0", diff --git a/frontend/src/components/ProductCard.tsx b/frontend/src/components/ProductCard.tsx index d60b3fe..36924d4 100644 --- a/frontend/src/components/ProductCard.tsx +++ b/frontend/src/components/ProductCard.tsx @@ -1,11 +1,8 @@ -import { useEffect } from 'react' -import { useShoppingCart } from '../contexts/ShoppingCartContext'; -import { useLocalStorage } from '../hooks/useLocalStorage'; -<<<<<<< HEAD -======= -import ShoppingCart from '../pages/ShoppingCart'; +import { useState, useEffect } from "react"; +import { useShoppingCart } from "../contexts/ShoppingCartContext"; +import { useLocalStorage } from "../hooks/useLocalStorage"; +import ShoppingCart from "../pages/ShoppingCart"; import Axios from "axios"; ->>>>>>> cd14ccc80038e5ec620f4f13cc1d5420599e0ed5 type ProductCardProps = { id: number; @@ -13,18 +10,8 @@ type ProductCardProps = { name: string; description: string; price: number; -<<<<<<< HEAD -} - -export default function ProductCard({ data }: { data: ProductCardProps[] }) { - const productlist = data.map(({ id, image, name, description, price }) => { - const { getItemQuantity, increaseItemQuantity, removeItem } = useShoppingCart(); - - const [isAdded, setIsAdded] = useLocalStorage<boolean>(`product-${id}`, false); - -======= id_tenant: number; -} +}; interface Product { id: number; @@ -32,92 +19,119 @@ interface Product { } export default function ProductCard({ data }: { data: ProductCardProps[] }) { - const { getItemQuantity, increaseItemQuantity, removeItem, cartItems } = useShoppingCart(); - - const productlist = data.map(({ id, image, name, description, price, id_tenant }) => { - const [isAdded, setIsAdded] = useLocalStorage<boolean>(`product-${id}`, false); - - // find cartItem id_tenant - - const [productData, setProductData] = useState<Product[]>([]); - - const getProductData = async () => { - const productResponse = await Axios.get("http://localhost:8000/products"); - - const productData = productResponse.data.data; - - const result = productData.map((product: Product) => { - return { - id: product.id, - id_tenant: product.id_tenant + const { getItemQuantity, increaseItemQuantity, removeItem, cartItems } = + useShoppingCart(); + + const productlist = data.map( + ({ id, image, name, description, price, id_tenant }) => { + const [isAdded, setIsAdded] = useLocalStorage<boolean>( + `product-${id}`, + false, + ); + + // find cartItem id_tenant + + const [productData, setProductData] = useState<Product[]>([]); + + const getProductData = async () => { + const productResponse = await Axios.get( + "http://localhost:8000/products", + ); + + const productData = productResponse.data.data; + + const result = productData.map((product: Product) => { + return { + id: product.id, + id_tenant: product.id_tenant, + }; + }); + + setProductData(result); + }; + + useEffect(() => { + getProductData(); + }, []); + + console.log(productData); + + useEffect(() => { + const quantity = getItemQuantity(id); + setIsAdded(quantity > 0); + }, [getItemQuantity, id, setIsAdded]); + + const handleClick = () => { + if (cartItems.length > 0) { + const cartItem = cartItems[0]; + const cartTenantId = + cartItem && + productData.find( + (product: Product) => product.id === cartItem.id, + )?.id_tenant; + if (cartTenantId !== id_tenant) { + alert( + "You can't add items from different tenants to the cart!", + ); + return; + } } - }); - - setProductData(result); - - }; - - useEffect(() => { - getProductData(); - }, []); - - console.log(productData); - ->>>>>>> cd14ccc80038e5ec620f4f13cc1d5420599e0ed5 - useEffect(() => { - const quantity = getItemQuantity(id); - setIsAdded(quantity > 0); - }, [getItemQuantity, id, setIsAdded]); - - const handleClick = () => { -<<<<<<< HEAD -======= - if (cartItems.length > 0) { - const cartItem = cartItems[0]; - const cartTenantId = cartItem && productData.find((product: Product) => product.id === cartItem.id)?.id_tenant; - if (cartTenantId !== id_tenant) { - alert("You can't add items from different tenants to the cart!"); - return; + if (isAdded) { + removeItem(id); + } else { + increaseItemQuantity(id); } - } ->>>>>>> cd14ccc80038e5ec620f4f13cc1d5420599e0ed5 - if (isAdded) { - removeItem(id); - } else { - increaseItemQuantity(id); - } - setIsAdded(!isAdded); - }; - - const priceidr = price.toString().replace(/\B(?=(\d{3})+(?!\d))/g, "."); - - return ( - <div key={id} className="flex bg-white justify-center items-center border-t border-gray-300 py-10 md:flex-row mx-16"> - <div className="flex flex-row w-full leading-normal"> - <div className="flex flex-col w-full"> - <h5 className="mb-4 text-2xl font-bold tracking-tight text-gray-900 w-5/6">{name}</h5> - <p className="my-4 font-normal text-lg text-gray-700 w-5/6">{description}</p> - <p className="mt-4 font-normal text-lg text-gray-500 w-5/6">Rp {priceidr},00</p> - </div> - <div className="flex flex-col justify-center items-center w-1/4 full"> - <div className="flex flex-row items-center h-36 w-36 rounded-3xl md:h-36 md:w-36 md:rounded-3xl mb-4"> - <img src={image} alt={name} className='object-cover h-full w-full rounded-3xl'> - </img> + setIsAdded(!isAdded); + }; + + const priceidr = price + .toString() + .replace(/\B(?=(\d{3})+(?!\d))/g, "."); + + return ( + <div + key={id} + className="flex bg-white justify-center items-center border-t border-gray-300 py-10 md:flex-row mx-16" + > + <div className="flex flex-row w-full leading-normal"> + <div className="flex flex-col w-full"> + <h5 className="mb-4 text-2xl font-bold tracking-tight text-gray-900 w-5/6"> + {name} + </h5> + <p className="my-4 font-normal text-lg text-gray-700 w-5/6"> + {description} + </p> + <p className="mt-4 font-normal text-lg text-gray-500 w-5/6"> + Rp {priceidr},00 + </p> </div> - <div className="flex flex-row items-center"> - <button - type="button" - className={`${isAdded ? 'text-mealshub-red hover:text-white border-2 border-mealshub-red hover:bg-mealshub-red' : 'text-white bg-mealshub-red hover:text-mealshub-red border-2 border-mealshub-red hover:bg-white'} font-bold text-lg rounded-full text-sm px-5 py-2.5 text-center`} - onClick={handleClick} - > - {isAdded ? "Added" : "Add to Cart"} - </button> + <div className="flex flex-col justify-center items-center w-1/4 full"> + <div className="flex flex-row items-center h-36 w-36 rounded-3xl md:h-36 md:w-36 md:rounded-3xl mb-4"> + <img + src={image} + alt={name} + className="object-cover h-full w-full rounded-3xl" + ></img> + </div> + <div className="flex flex-row items-center"> + <button + type="button" + className={`${ + isAdded + ? "text-mealshub-red hover:text-white border-2 border-mealshub-red hover:bg-mealshub-red" + : "text-white bg-mealshub-red hover:text-mealshub-red border-2 border-mealshub-red hover:bg-white" + } font-bold text-lg rounded-full text-sm px-5 py-2.5 text-center`} + onClick={handleClick} + > + {isAdded ? "Added" : "Add to Cart"} + </button> + </div> </div> </div> </div> - </div> - ) - }); + ); + }, + ); return productlist; -} \ No newline at end of file +} diff --git a/frontend/src/pages/OrderSummary.tsx b/frontend/src/pages/OrderSummary.tsx index 3e9d820..88af4d0 100644 --- a/frontend/src/pages/OrderSummary.tsx +++ b/frontend/src/pages/OrderSummary.tsx @@ -9,59 +9,67 @@ import { useParams } from "react-router-dom"; import crypto from "crypto-js"; interface Order { - id: number, - status: string, - time: Date, - id_table: number, - id_tenant: number + id: number; + status: string; + time: Date; + id_table: number; + id_tenant: number; } interface OrderProduct { - num_product: number, - id_product: number, - id_order: number + num_product: number; + id_product: number; + id_order: number; } interface Product { - id: number, - name: string, - price: number + id: number; + name: string; + price: number; } interface Tenant { - id: number, - name: string + id: number; + name: string; } interface Payment { - id: number, - status: string, - id_order: number + id: number; + status: string; + id_order: number; } interface OrderSummary { - id: number, - name: string, - orderlist: (string | number)[][] + id: number; + name: string; + orderlist: (string | number)[][]; } interface OrderDetails { - orderid: number, - code: string | null, - tableid: number, - time: Date, - orderstatus: string, - paymentstatus: string + orderid: number; + code: string | null; + tableid: number; + time: Date; + orderstatus: string; + paymentstatus: string; } export default function OrderSummary() { const { orderid } = useParams(); - const [joinedOrderSummaryData, setJoinedOrderSummaryData] = useState<OrderSummary[]>([]); + const [joinedOrderSummaryData, setJoinedOrderSummaryData] = useState< + OrderSummary[] + >([]); const getOrderSummaryData = async () => { - const orderResponse = await Axios.get(`http://localhost:8000/orders/${orderid}`); - const productResponse = await Axios.get("http://localhost:8000/products"); - const orderProductResponse = await Axios.get("http://localhost:8000/orderproduct"); + const orderResponse = await Axios.get( + `http://localhost:8000/orders/${orderid}`, + ); + const productResponse = await Axios.get( + "http://localhost:8000/products", + ); + const orderProductResponse = await Axios.get( + "http://localhost:8000/orderproduct", + ); const tenantResponse = await Axios.get("http://localhost:8000/tenants"); const orderData = orderResponse.data.data; @@ -73,22 +81,35 @@ export default function OrderSummary() { // OrderData is not an array, so we need to convert it into an array const orderDataArray = [orderData]; const result = orderDataArray.map((order: Order) => { - const tenant = tenantData.find((tenant: Tenant) => tenant.id === order.id_tenant); - const orderproduct = orderProductData.filter((orderProduct: OrderProduct) => orderProduct.id_order === order.id); - const listproduct = orderproduct.map((orderProduct: OrderProduct) => { - const product = productData.find((product: Product) => product.id === orderProduct.id_product); - return [product?.name || 'Product Not Found', orderProduct.num_product, product?.price || 0]; - }); - + const tenant = tenantData.find( + (tenant: Tenant) => tenant.id === order.id_tenant, + ); + const orderproduct = orderProductData.filter( + (orderProduct: OrderProduct) => + orderProduct.id_order === order.id, + ); + const listproduct = orderproduct.map( + (orderProduct: OrderProduct) => { + const product = productData.find( + (product: Product) => + product.id === orderProduct.id_product, + ); + return [ + product?.name || "Product Not Found", + orderProduct.num_product, + product?.price || 0, + ]; + }, + ); + return { id: tenant?.id || 0, - name: tenant?.name || 'Tenant Not Found', - orderlist: listproduct + name: tenant?.name || "Tenant Not Found", + orderlist: listproduct, }; - }); + }); setJoinedOrderSummaryData(result); - }; useEffect(() => { @@ -97,11 +118,17 @@ export default function OrderSummary() { console.log(joinedOrderSummaryData); - const [joinedOrderDetailsData, setJoinedOrderDetailsData] = useState<OrderDetails[]>([]); + const [joinedOrderDetailsData, setJoinedOrderDetailsData] = useState< + OrderDetails[] + >([]); const getOrderDetailsData = async () => { - const orderResponse = await Axios.get(`http://localhost:8000/orders/${orderid}`); - const paymentResponse = await Axios.get("http://localhost:8000/payments"); + const orderResponse = await Axios.get( + `http://localhost:8000/orders/${orderid}`, + ); + const paymentResponse = await Axios.get( + "http://localhost:8000/payments", + ); const orderData = orderResponse.data.data; const paymentData = paymentResponse.data.data; @@ -109,10 +136,17 @@ export default function OrderSummary() { // Perform the join based on the specified conditions const OrderDataArray = [orderData]; const result = OrderDataArray.map((order: Order) => { - const matchingPayment = paymentData.find((payment: Payment) => payment.id_order === order.id); + const matchingPayment = paymentData.find( + (payment: Payment) => payment.id_order === order.id, + ); // Hash the code (matchingPayment.id) using SHA-256 from crypto-js and take the first 5 characters - const hashedCode = matchingPayment ? crypto.SHA256(matchingPayment.id.toString()).toString().substring(0, 5) : null; + const hashedCode = matchingPayment + ? crypto + .SHA256(matchingPayment.id.toString()) + .toString() + .substring(0, 5) + : null; return { orderid: order.id, @@ -120,7 +154,7 @@ export default function OrderSummary() { tableid: order.id_table, time: order.time, orderstatus: order.status, - paymentstatus: matchingPayment ? matchingPayment.status : null + paymentstatus: matchingPayment ? matchingPayment.status : null, }; }); @@ -140,40 +174,60 @@ export default function OrderSummary() { <div className="grid grid-cols-5 grid-rows-8 bg-mealshub-cream min-h-screen"> {/* Sidebar */} <div className="col-span-1 row-span-8"> - <Sidebar customer={true} number={3} current={3} menu1="Home" page1="/" path1="M27 14.6465V29.4398C27 30.1188 26.7629 30.77 26.341 31.2501C25.919 31.7303 25.3467 32 24.75 32H19.125C18.5282 32 17.9559 31.7303 17.534 31.2501C17.112 30.77 16.875 30.1188 16.875 29.4398V23.0392C16.875 22.6997 16.7565 22.3741 16.5455 22.1341C16.3345 21.894 16.0484 21.7591 15.75 21.7591H11.25C10.9516 21.7591 10.6655 21.894 10.4545 22.1341C10.2435 22.3741 10.125 22.6997 10.125 23.0392V29.4398C10.125 30.1188 9.88794 30.77 9.46598 31.2501C9.04402 31.7303 8.47173 32 7.87499 32H2.25C1.65326 32 1.08097 31.7303 0.659009 31.2501C0.237052 30.77 2.59985e-08 30.1188 2.59985e-08 29.4398V14.6465C-4.73102e-05 14.2922 0.0645457 13.9417 0.189691 13.6172C0.314836 13.2928 0.497809 13.0014 0.72703 12.7616L11.977 0.683737L11.9925 0.666135C12.4067 0.237512 12.9464 0 13.5063 0C14.0662 0 14.6059 0.237512 15.0201 0.666135C15.0249 0.672397 15.0301 0.678277 15.0356 0.683737L26.2856 12.7616C26.5125 13.0027 26.6931 13.2946 26.8161 13.619C26.939 13.9434 27.0016 14.2933 27 14.6465Z" menu2="Shopping Cart" page2="/cart" path2="M22.2968 25.6C20.7499 25.6 19.5097 27.024 19.5097 28.8C19.5097 29.6487 19.8033 30.4626 20.326 31.0627C20.8487 31.6629 21.5576 32 22.2968 32C23.036 32 23.7449 31.6629 24.2675 31.0627C24.7902 30.4626 25.0839 29.6487 25.0839 28.8C25.0839 27.9513 24.7902 27.1374 24.2675 26.5373C23.7449 25.9371 23.036 25.6 22.2968 25.6ZM0 0V3.2H2.7871L7.80387 15.344L5.90864 19.264C5.69961 19.712 5.57419 20.24 5.57419 20.8C5.57419 21.6487 5.86783 22.4626 6.39051 23.0627C6.9132 23.6629 7.62211 24 8.36129 24H25.0839V20.8H8.94658C8.85418 20.8 8.76557 20.7579 8.70023 20.6828C8.6349 20.6078 8.59819 20.5061 8.59819 20.4C8.59819 20.32 8.61213 20.256 8.64 20.208L9.89419 17.6H20.2761C21.3213 17.6 22.241 16.928 22.7148 15.952L27.7037 5.6C27.8013 5.344 27.871 5.072 27.871 4.8C27.871 4.37565 27.7241 3.96869 27.4628 3.66863C27.2015 3.36857 26.847 3.2 26.4774 3.2H5.86684L4.5569 0M8.36129 25.6C6.81445 25.6 5.57419 27.024 5.57419 28.8C5.57419 29.6487 5.86783 30.4626 6.39051 31.0627C6.9132 31.6629 7.62211 32 8.36129 32C9.10047 32 9.80938 31.6629 10.3321 31.0627C10.8547 30.4626 11.1484 29.6487 11.1484 28.8C11.1484 27.9513 10.8547 27.1374 10.3321 26.5373C9.80938 25.9371 9.10047 25.6 8.36129 25.6Z" menu3="Orders" page3={`/order/list/${tableid}`} path3="M4.10306 1.10306C3 2.20612 3 3.97929 3 7.52941V24.4706C3 28.0207 3 29.7939 4.10306 30.8969C5.20612 32 6.97929 32 10.5294 32H21.8235C25.3736 32 27.1468 32 28.2499 30.8969C29.3529 29.7939 29.3529 28.0207 29.3529 24.4706V7.52941C29.3529 3.97929 29.3529 2.20612 28.2499 1.10306C27.1468 -1.12197e-07 25.3736 0 21.8235 0H10.5294C6.97929 0 5.20612 -1.12197e-07 4.10306 1.10306ZM10.5294 7.52941C10.0302 7.52941 9.5514 7.72773 9.19839 8.08074C8.84538 8.43375 8.64706 8.91253 8.64706 9.41176C8.64706 9.911 8.84538 10.3898 9.19839 10.7428C9.5514 11.0958 10.0302 11.2941 10.5294 11.2941H21.8235C22.3228 11.2941 22.8015 11.0958 23.1546 10.7428C23.5076 10.3898 23.7059 9.911 23.7059 9.41176C23.7059 8.91253 23.5076 8.43375 23.1546 8.08074C22.8015 7.72773 22.3228 7.52941 21.8235 7.52941H10.5294ZM10.5294 15.0588C10.0302 15.0588 9.5514 15.2571 9.19839 15.6102C8.84538 15.9632 8.64706 16.4419 8.64706 16.9412C8.64706 17.4404 8.84538 17.9192 9.19839 18.2722C9.5514 18.6252 10.0302 18.8235 10.5294 18.8235H21.8235C22.3228 18.8235 22.8015 18.6252 23.1546 18.2722C23.5076 17.9192 23.7059 17.4404 23.7059 16.9412C23.7059 16.4419 23.5076 15.9632 23.1546 15.6102C22.8015 15.2571 22.3228 15.0588 21.8235 15.0588H10.5294ZM10.5294 22.5882C10.0302 22.5882 9.5514 22.7866 9.19839 23.1396C8.84538 23.4926 8.64706 23.9714 8.64706 24.4706C8.64706 24.9698 8.84538 25.4486 9.19839 25.8016C9.5514 26.1546 10.0302 26.3529 10.5294 26.3529H18.0588C18.5581 26.3529 19.0368 26.1546 19.3898 25.8016C19.7429 25.4486 19.9412 24.9698 19.9412 24.4706C19.9412 23.9714 19.7429 23.4926 19.3898 23.1396C19.0368 22.7866 18.5581 22.5882 18.0588 22.5882H10.5294Z"/> + <Sidebar + customer={true} + number={3} + current={3} + menu1="Home" + page1="/" + path1="M27 14.6465V29.4398C27 30.1188 26.7629 30.77 26.341 31.2501C25.919 31.7303 25.3467 32 24.75 32H19.125C18.5282 32 17.9559 31.7303 17.534 31.2501C17.112 30.77 16.875 30.1188 16.875 29.4398V23.0392C16.875 22.6997 16.7565 22.3741 16.5455 22.1341C16.3345 21.894 16.0484 21.7591 15.75 21.7591H11.25C10.9516 21.7591 10.6655 21.894 10.4545 22.1341C10.2435 22.3741 10.125 22.6997 10.125 23.0392V29.4398C10.125 30.1188 9.88794 30.77 9.46598 31.2501C9.04402 31.7303 8.47173 32 7.87499 32H2.25C1.65326 32 1.08097 31.7303 0.659009 31.2501C0.237052 30.77 2.59985e-08 30.1188 2.59985e-08 29.4398V14.6465C-4.73102e-05 14.2922 0.0645457 13.9417 0.189691 13.6172C0.314836 13.2928 0.497809 13.0014 0.72703 12.7616L11.977 0.683737L11.9925 0.666135C12.4067 0.237512 12.9464 0 13.5063 0C14.0662 0 14.6059 0.237512 15.0201 0.666135C15.0249 0.672397 15.0301 0.678277 15.0356 0.683737L26.2856 12.7616C26.5125 13.0027 26.6931 13.2946 26.8161 13.619C26.939 13.9434 27.0016 14.2933 27 14.6465Z" + menu2="Shopping Cart" + page2="/cart" + path2="M22.2968 25.6C20.7499 25.6 19.5097 27.024 19.5097 28.8C19.5097 29.6487 19.8033 30.4626 20.326 31.0627C20.8487 31.6629 21.5576 32 22.2968 32C23.036 32 23.7449 31.6629 24.2675 31.0627C24.7902 30.4626 25.0839 29.6487 25.0839 28.8C25.0839 27.9513 24.7902 27.1374 24.2675 26.5373C23.7449 25.9371 23.036 25.6 22.2968 25.6ZM0 0V3.2H2.7871L7.80387 15.344L5.90864 19.264C5.69961 19.712 5.57419 20.24 5.57419 20.8C5.57419 21.6487 5.86783 22.4626 6.39051 23.0627C6.9132 23.6629 7.62211 24 8.36129 24H25.0839V20.8H8.94658C8.85418 20.8 8.76557 20.7579 8.70023 20.6828C8.6349 20.6078 8.59819 20.5061 8.59819 20.4C8.59819 20.32 8.61213 20.256 8.64 20.208L9.89419 17.6H20.2761C21.3213 17.6 22.241 16.928 22.7148 15.952L27.7037 5.6C27.8013 5.344 27.871 5.072 27.871 4.8C27.871 4.37565 27.7241 3.96869 27.4628 3.66863C27.2015 3.36857 26.847 3.2 26.4774 3.2H5.86684L4.5569 0M8.36129 25.6C6.81445 25.6 5.57419 27.024 5.57419 28.8C5.57419 29.6487 5.86783 30.4626 6.39051 31.0627C6.9132 31.6629 7.62211 32 8.36129 32C9.10047 32 9.80938 31.6629 10.3321 31.0627C10.8547 30.4626 11.1484 29.6487 11.1484 28.8C11.1484 27.9513 10.8547 27.1374 10.3321 26.5373C9.80938 25.9371 9.10047 25.6 8.36129 25.6Z" + menu3="Orders" + page3={`/order/list/${tableid}`} + path3="M4.10306 1.10306C3 2.20612 3 3.97929 3 7.52941V24.4706C3 28.0207 3 29.7939 4.10306 30.8969C5.20612 32 6.97929 32 10.5294 32H21.8235C25.3736 32 27.1468 32 28.2499 30.8969C29.3529 29.7939 29.3529 28.0207 29.3529 24.4706V7.52941C29.3529 3.97929 29.3529 2.20612 28.2499 1.10306C27.1468 -1.12197e-07 25.3736 0 21.8235 0H10.5294C6.97929 0 5.20612 -1.12197e-07 4.10306 1.10306ZM10.5294 7.52941C10.0302 7.52941 9.5514 7.72773 9.19839 8.08074C8.84538 8.43375 8.64706 8.91253 8.64706 9.41176C8.64706 9.911 8.84538 10.3898 9.19839 10.7428C9.5514 11.0958 10.0302 11.2941 10.5294 11.2941H21.8235C22.3228 11.2941 22.8015 11.0958 23.1546 10.7428C23.5076 10.3898 23.7059 9.911 23.7059 9.41176C23.7059 8.91253 23.5076 8.43375 23.1546 8.08074C22.8015 7.72773 22.3228 7.52941 21.8235 7.52941H10.5294ZM10.5294 15.0588C10.0302 15.0588 9.5514 15.2571 9.19839 15.6102C8.84538 15.9632 8.64706 16.4419 8.64706 16.9412C8.64706 17.4404 8.84538 17.9192 9.19839 18.2722C9.5514 18.6252 10.0302 18.8235 10.5294 18.8235H21.8235C22.3228 18.8235 22.8015 18.6252 23.1546 18.2722C23.5076 17.9192 23.7059 17.4404 23.7059 16.9412C23.7059 16.4419 23.5076 15.9632 23.1546 15.6102C22.8015 15.2571 22.3228 15.0588 21.8235 15.0588H10.5294ZM10.5294 22.5882C10.0302 22.5882 9.5514 22.7866 9.19839 23.1396C8.84538 23.4926 8.64706 23.9714 8.64706 24.4706C8.64706 24.9698 8.84538 25.4486 9.19839 25.8016C9.5514 26.1546 10.0302 26.3529 10.5294 26.3529H18.0588C18.5581 26.3529 19.0368 26.1546 19.3898 25.8016C19.7429 25.4486 19.9412 24.9698 19.9412 24.4706C19.9412 23.9714 19.7429 23.4926 19.3898 23.1396C19.0368 22.7866 18.5581 22.5882 18.0588 22.5882H10.5294Z" + /> </div> {/* Header */} <div className="col-span-4"> <div className="row-span-1 ms-20 mt-9 py-3 w-11/12"> - <WelcomingText name="Table 1"/> + <WelcomingText name="Table 1" /> </div> <div className="row-span-7 mt-6 mb-9 w-11/12"> <div className="ms-4"> <BackButton page={`/order/list/${tableid}`} /> </div> <div className="ms-20 py-12 bg-white rounded-3xl"> - <h2 className="text-mealshub-red text-3xl font-bold ms-16">Order Summary</h2> + <h2 className="text-mealshub-red text-3xl font-bold ms-16"> + Order Summary + </h2> <OrderDetailsCard data={joinedOrderDetailsData} /> -<<<<<<< HEAD - <OrderSummaryCard data={joinedOrderSummaryData} /> -======= - <OrderSummaryCard data={joinedOrderSummaryData} customer={true} /> + <OrderSummaryCard + data={joinedOrderSummaryData} + customer={true} + /> {joinedOrderDetailsData.map((order) => { - if (order.paymentstatus === "Waiting for Confirmation") { + if ( + order.paymentstatus === + "Waiting for Confirmation" + ) { return ( <div className="ms-16 my-3 font-normal text-lg text-gray-900"> <span className="text-mealshub-red font-semibold font-italic"> - Your payment is not confirmed yet. Don’t forget to show your Unique Code and pay order to the central cashier! + Your payment is not confirmed yet. + Don’t forget to show your Unique + Code and pay order to the central + cashier! </span> </div> - ) + ); } return null; })} ->>>>>>> cd14ccc80038e5ec620f4f13cc1d5420599e0ed5 </div> </div> </div> </div> - ) -} \ No newline at end of file + ); +} -- GitLab