From 38c83d51433c2f9c502e51c1a1ca8573d5e239c9 Mon Sep 17 00:00:00 2001 From: Mohammed Al-yaseen Date: Wed, 31 Dec 2025 00:57:05 +0300 Subject: [PATCH] add order details & enhance the checkout page --- src/assets/locals/ar.json | 2 + src/assets/locals/en.json | 2 + .../ProRatioGroups/ProRatioGroups.module.css | 89 +++++ .../ProRatioGroups/ProRatioGroups.tsx | 4 +- src/pages/cart/components/CarPlateCard.tsx | 22 +- .../components/CartMobileTabletLayout.tsx | 4 +- .../SpecialRequestCard.module.css | 5 + .../checkout/components/BriefMenuCard.tsx | 9 +- src/pages/checkout/page.tsx | 6 + src/pages/login/page.tsx | 6 +- .../order/components/OrderDetails.module.css | 316 ++++++++++++++++++ src/pages/order/components/OrderDetails.tsx | 166 +++++++++ src/pages/order/page.tsx | 2 +- .../splitBill/SplitBillChoiceBottomSheet.tsx | 6 +- src/routes/routes.tsx | 6 + 15 files changed, 623 insertions(+), 22 deletions(-) create mode 100644 src/pages/order/components/OrderDetails.module.css create mode 100644 src/pages/order/components/OrderDetails.tsx diff --git a/src/assets/locals/ar.json b/src/assets/locals/ar.json index cdbbb4c..3b0ad26 100644 --- a/src/assets/locals/ar.json +++ b/src/assets/locals/ar.json @@ -370,6 +370,8 @@ }, "order": { "title": "الطلب", + "yourOrder": "طلبك", + "done": "تم", "yourOrderFromFascanoRestaurant": "طلبك من مطعم فاسكانو", "muscat": "مسقط", "reserved": "محجوز", diff --git a/src/assets/locals/en.json b/src/assets/locals/en.json index 92a169e..9f56a00 100644 --- a/src/assets/locals/en.json +++ b/src/assets/locals/en.json @@ -381,6 +381,8 @@ }, "order": { "title": "Order", + "yourOrder": "Your Order", + "done": "Done", "yourOrderFromFascanoRestaurant": "Your order from Fascano restaurant", "muscat": "Muscat", "reserved": "Reserved", diff --git a/src/components/ProRatioGroups/ProRatioGroups.module.css b/src/components/ProRatioGroups/ProRatioGroups.module.css index 3f75c60..e85d8ef 100644 --- a/src/components/ProRatioGroups/ProRatioGroups.module.css +++ b/src/components/ProRatioGroups/ProRatioGroups.module.css @@ -17,3 +17,92 @@ width: 24px !important; height: 24px !important; } + +/* Make AntD checkbox look like a circular check indicator (scoped via CSS modules) */ +.circleCheckbox :global(.ant-checkbox-inner) { + width: 24px; + height: 24px; + border-radius: 50% !important; + border: 1.5px solid #d5d8da; + background: transparent; +} + +.circleCheckbox :global(.ant-checkbox-checked .ant-checkbox-inner) { + border-radius: 50% !important; + background: transparent; + border-color: #ffb700; +} + +/* Replace AntD checkmark with a filled inner circle when checked (match SVG) */ +.circleCheckbox :global(.ant-checkbox-inner::after) { + content: ""; + border: 0 !important; + transform: none !important; + width: 0; + height: 0; + left: 50%; + top: 50%; +} + +:global(.ant-app-rtl) .circleCheckbox :global(.ant-checkbox-inner::after) { + left: auto; + right: 50%; +} + +.circleCheckbox :global(.ant-checkbox-checked .ant-checkbox-inner::after) { + width: 18px; + height: 18px; + margin-left: -9px; + margin-top: -9px; + border-radius: 50%; + background: #ffb700; +} + +:global(.ant-app-rtl) .circleCheckbox :global(.ant-checkbox-checked .ant-checkbox-inner::after) { + margin-left: auto; + margin-right: -9px; +} + +/* Apply same circular style to Radio buttons */ +.circleCheckbox :global(.ant-radio-inner) { + width: 24px; + height: 24px; + border-radius: 50% !important; + border: 1.5px solid #d5d8da; + background: transparent; +} + +.circleCheckbox :global(.ant-radio-checked .ant-radio-inner) { + border-radius: 50% !important; + background: transparent; + border-color: #ffb700; +} + +.circleCheckbox :global(.ant-radio-inner::after) { + content: ""; + border: 0 !important; + transform: none !important; + width: 0; + height: 0; + left: 50%; + top: 50%; +} + +:global(.ant-app-rtl) .circleCheckbox :global(.ant-radio-inner::after) { + left: auto; + right: 50%; +} + +.circleCheckbox :global(.ant-radio-checked .ant-radio-inner::after) { + width: 18px; + height: 18px; + margin-left: -9px; + margin-top: -9px; + border-radius: 50%; + background: #ffb700; +} + +:global(.ant-app-rtl) .circleCheckbox :global(.ant-radio-checked .ant-radio-inner::after) { + margin-left: auto; + margin-right: -9px; +} diff --git a/src/components/ProRatioGroups/ProRatioGroups.tsx b/src/components/ProRatioGroups/ProRatioGroups.tsx index 2438da4..03e12c7 100644 --- a/src/components/ProRatioGroups/ProRatioGroups.tsx +++ b/src/components/ProRatioGroups/ProRatioGroups.tsx @@ -42,9 +42,7 @@ const ProRatioGroups = ({
state.order.plateCar); return ( <> - - + + { dispatch(updatePlateCar(e.target.value)); diff --git a/src/pages/cart/components/CartMobileTabletLayout.tsx b/src/pages/cart/components/CartMobileTabletLayout.tsx index 87c41e6..00ed324 100644 --- a/src/pages/cart/components/CartMobileTabletLayout.tsx +++ b/src/pages/cart/components/CartMobileTabletLayout.tsx @@ -257,8 +257,8 @@ export default function CartMobileTabletLayout({ orderType === OrderType.ScheduledOrder) && } {/* Estimate Time */} - {(orderType === OrderType.Pickup || - orderType === OrderType.ScheduledOrder) && } + {/* {(orderType === OrderType.Pickup || + orderType === OrderType.ScheduledOrder) && } */} {/* Collection Method */} {/* {orderType === OrderType.Pickup && ( diff --git a/src/pages/cart/components/specialRequest/SpecialRequestCard.module.css b/src/pages/cart/components/specialRequest/SpecialRequestCard.module.css index e34b639..7348049 100644 --- a/src/pages/cart/components/specialRequest/SpecialRequestCard.module.css +++ b/src/pages/cart/components/specialRequest/SpecialRequestCard.module.css @@ -7,6 +7,11 @@ padding-left: 16px; opacity: 1; border-width: 1px; + font-weight: 400; + font-style: normal; + font-size: 12px; + line-height: 140%; + letter-spacing: 0; } .editButton { diff --git a/src/pages/checkout/components/BriefMenuCard.tsx b/src/pages/checkout/components/BriefMenuCard.tsx index 6c4668a..3e3fd10 100644 --- a/src/pages/checkout/components/BriefMenuCard.tsx +++ b/src/pages/checkout/components/BriefMenuCard.tsx @@ -5,7 +5,7 @@ import ProText from "components/ProText"; import { useTranslation } from "react-i18next"; import { useAppSelector } from "redux/hooks"; import { selectCart } from "features/order/orderSlice"; -import { useNavigate, useParams } from "react-router-dom"; +import { useLocation, useNavigate, useParams } from "react-router-dom"; import { useGetOrderDetailsQuery } from "redux/api/others"; import BackIcon from "components/Icons/BackIcon"; @@ -14,6 +14,7 @@ export default function BriefMenuCard() { const { items } = useAppSelector(selectCart); const { subdomain, orderId } = useParams(); const navigate = useNavigate(); + const location = useLocation(); const { data: orderDetails } = useGetOrderDetailsQuery( { orderID: orderId || "", @@ -41,7 +42,11 @@ export default function BriefMenuCard() { padding: "16px 0", }} onClick={() => { - navigate(`/${subdomain}/cart`); + if (orderId && location.pathname.includes("/order/")) { + navigate(`/${subdomain}/order/details/${orderId}`); + } else { + navigate(`/${subdomain}/cart`); + } }} > {t("checkout.title")} + {(orderType === OrderType.Pickup || + orderType === OrderType.ScheduledOrder) && } + {!token && } @@ -101,6 +106,7 @@ export default function CheckoutPage() { {/* Reward Your Waiter */} + diff --git a/src/pages/login/page.tsx b/src/pages/login/page.tsx index 2362478..eff1f33 100644 --- a/src/pages/login/page.tsx +++ b/src/pages/login/page.tsx @@ -135,7 +135,11 @@ export default function LoginPage() { /> - + + + + + ); +} diff --git a/src/pages/order/page.tsx b/src/pages/order/page.tsx index 3e786ea..30af95f 100644 --- a/src/pages/order/page.tsx +++ b/src/pages/order/page.tsx @@ -220,7 +220,7 @@ export default function OrderPage() { return ( <> - {t("order.title")} + {t("order.title")}
- {t("splitBill.payAsCustomAmount")} + {t("splitBill.customAmount")} {isRTL ? ( @@ -116,7 +116,7 @@ export function SplitBillChoiceBottomSheet({ fontSize: 14, }} > - {t("splitBill.divideTheBillEqually")} + {t("splitBill.divideEqually")} {isRTL ? ( @@ -145,7 +145,7 @@ export function SplitBillChoiceBottomSheet({ fontSize: 14, }} > - {t("splitBill.payForYourItems")} + {t("splitBill.payForItems")} {isRTL ? ( diff --git a/src/routes/routes.tsx b/src/routes/routes.tsx index 14f6ccf..485f8d5 100644 --- a/src/routes/routes.tsx +++ b/src/routes/routes.tsx @@ -9,6 +9,7 @@ import CheckoutPage from "pages/checkout/page"; import { Error400Page, ErrorPage } from "pages/errors"; import LoginPage from "pages/login/page"; import MenuPage from "pages/menu/page"; +import OrderDetails from "pages/order/components/OrderDetails"; import OrderPage from "pages/order/page"; import OrdersPage from "pages/orders/page"; import OtpPage from "pages/otp/page"; @@ -143,6 +144,11 @@ export const router = createHashRouter([ element: } />, errorElement: , }, + { + path: "order/details/:orderId", + element: } />, + errorElement: , + }, { path: "pay", element: } />,