diff --git a/src/ThemeConstants.ts b/src/ThemeConstants.ts
index b6fb662..c8c39d9 100644
--- a/src/ThemeConstants.ts
+++ b/src/ThemeConstants.ts
@@ -2,7 +2,7 @@
import type { ThemeConfig } from "antd";
export const colors = {
- primary: "#FFC600",
+ primary: "#CC9300",
secondary: "linear-gradient(135deg, #00C1D4 0%, #FF5F6D 100%)",
darkSpace: "linear-gradient(to right, #0F0525, #2A0B45)",
};
diff --git a/src/components/LoyaltyCard/LoyaltyCard.tsx b/src/components/LoyaltyCard/LoyaltyCard.tsx
index 5ac5f74..d92c24d 100644
--- a/src/components/LoyaltyCard/LoyaltyCard.tsx
+++ b/src/components/LoyaltyCard/LoyaltyCard.tsx
@@ -22,81 +22,66 @@ const LoyaltyCard = () => {
return (
- {isHasLoyaltyGift && (
-
-
-
-
- {t("menu.congratulations")}
-
-
- {t("menu.loyaltyGiftEarned")}
-
-
-
- )}
- {!isHasLoyaltyGift && (
-
-
-
-
-
-
-
-
- {t("menu.loyaltyPoints")}
-
-
-
-
- {token &&
- t("menu.loyaltyDescription", {
- value: restaurant?.loyalty_stamps ?? 0,
- })}
- {!token && (
-
-
- {t("menu.joinUs")}
-
-
- {t("menu.joinUsDescription")}
-
-
- )}
-
-
- {/* */}
-
- )}
- {token && !isHasLoyaltyGift && (
+
+
+
+
+
+
+
+
+ {t("menu.loyaltyPoints")}
+
+
+
+
+ {token &&
+ t("menu.loyaltyDescription", {
+ value: restaurant?.loyalty_stamps ?? 0,
+ })}
+ {!token && (
+
+
+ {t("menu.joinUs")}
+
+
+ {t("menu.joinUsDescription")}
+
+
+ )}
+
+
+ {isHasLoyaltyGift && }
+
+ {token && (
diff --git a/src/pages/address/address.module.css b/src/pages/address/address.module.css
index e07cbd3..38554fe 100644
--- a/src/pages/address/address.module.css
+++ b/src/pages/address/address.module.css
@@ -172,6 +172,11 @@
z-index: 999;
}
+/* Dark theme styles for checkout */
+:global(.darkApp) .checkoutButtonContainer {
+ background-color: #000000 !important;
+}
+
.splitBillButton {
border-radius: 100px;
height: 48px;
@@ -221,10 +226,7 @@
font-size: 14px;
}
-/* Dark theme styles for checkout */
-:global(.darkApp) .checkoutButtonContainer {
- background-color: #000000 !important;
-}
+
:global(.darkApp) .splitBillButton {
color: #ffffff !important;
diff --git a/src/pages/checkout/page.tsx b/src/pages/checkout/page.tsx
index da7a428..73081c5 100644
--- a/src/pages/checkout/page.tsx
+++ b/src/pages/checkout/page.tsx
@@ -24,6 +24,7 @@ export default function CheckoutPage() {
const { phone, order, orderType, collectionMethod } =
useAppSelector(selectCart);
const { token } = useAppSelector((state) => state.auth);
+
return (
<>
+ }
+ >
+
+ {orderDetails?.orderItems.map((item, index) => (
+
+ ))}
+
+
+
+
+
+ {/* */}
+
+
+
+
+
+
+
+ {/* */}
+
+
+ );
+}
diff --git a/src/pages/orders/OrdersList.tsx b/src/pages/orders/OrdersList.tsx
index dc54efa..ab40106 100644
--- a/src/pages/orders/OrdersList.tsx
+++ b/src/pages/orders/OrdersList.tsx
@@ -9,6 +9,7 @@ import { useTranslation } from "react-i18next";
import { useGetOrdersQuery } from "redux/api/others";
import { colors } from "ThemeConstants";
import styles from "./orders.module.css";
+import { Link, useParams } from "react-router-dom";
// Utility function to format date
const formatDate = (dateString: string): string => {
@@ -29,7 +30,7 @@ const formatDate = (dateString: string): string => {
export default function OrdersList() {
const { data: orders = [], isLoading, error, refetch } = useGetOrdersQuery();
-
+ const { subdomain } = useParams();
const { t } = useTranslation();
if (isLoading) {
@@ -44,7 +45,7 @@ export default function OrdersList() {
flexDirection: "column",
justifyContent: "center",
alignItems: "center",
- height: "90vh",
+ height: "100vh",
}}
>
{t("orders.errorLoadingOrders")}
@@ -53,6 +54,34 @@ export default function OrdersList() {
);
}
+ // Determine button styles based on order status
+ const getStatusButtonStyles = (order: any) => {
+ const status = order?.status?.toLowerCase() || "";
+
+ if (status.includes("close") || status === "closed") {
+ return {
+ backgroundColor: "var(--color-error-12, #EA1F221F)",
+ color: "#EA1F22",
+ };
+ } else if (status.includes("completed") || status === "complete") {
+ return {
+ backgroundColor: "var(--color-success-12, #28A7451F)",
+ color: "#28A745",
+ };
+ } else if (status.includes("preparing") || status.includes("prepare")) {
+ return {
+ backgroundColor: "var(--Color-Primary-100, #FFB7001F)",
+ color: "#FFB700",
+ };
+ }
+
+ // Default fallback
+ return {
+ backgroundColor: "var(--color-success-12, #28A7451F)",
+ color: "#28A745",
+ };
+ };
+
return (
<>
{orders.length === 0 ? (
@@ -64,94 +93,99 @@ export default function OrdersList() {
justifyContent: "center",
alignItems: "center",
height: "90vh",
- padding: "1rem"
+ padding: "1rem",
}}
>
{t("orders.noOrdersFound")}
-
- {t("orders.youHavenTPlacedAnyOrdersYet")}
-
+ {t("orders.youHavenTPlacedAnyOrdersYet")}
) : (
// Orders list
{orders.map((order: any) => (
-
-
+
-
-
-
- {order.restaurant_name}
-
-
- {formatDate(order?.created_at)}
-
-
- {t("orders.orderID")} {order.id}
-
+
+
+ {order.restaurant_name}
+
+
+ {formatDate(order?.created_at)}
+
+
+ {t("orders.orderID")} {order.id}
+
+
+
-
-
-
-
-
-
- {t("orders.rateOrder")}
- {" "}
-
+
+
+
+
+
+ {t("orders.rateOrder")}
+ {" "}
+
-
-
-
- {t("orders.reOrder")}
-
+
+
+
+ {t("orders.reOrder")}
+
+
-
-
+
+
))}
)}
diff --git a/src/pages/orders/page.tsx b/src/pages/orders/page.tsx
index 3767457..6053cdf 100644
--- a/src/pages/orders/page.tsx
+++ b/src/pages/orders/page.tsx
@@ -1,25 +1,23 @@
-import { Button, Row } from "antd";
import ProHeader from "components/ProHeader/ProHeader";
import { useTranslation } from "react-i18next";
-import { Link, useParams } from "react-router-dom";
-import styles from "./orders.module.css";
+import { useParams } from "react-router-dom";
import OrdersList from "./OrdersList";
+import OrderDetails from "./OrderDetails";
export default function OrdersPage() {
const { t } = useTranslation();
- const { subdomain } = useParams();
+ const { orderId } = useParams();
return (
<>
- {t("orders.title")}
-
-
-
-
-
-
+ {orderId ? (
+
+ ) : (
+ <>
+ {t("orders.title")}
+
+ >
+ )}
>
);
}
diff --git a/src/routes/routes.tsx b/src/routes/routes.tsx
index a62d2ff..14f6ccf 100644
--- a/src/routes/routes.tsx
+++ b/src/routes/routes.tsx
@@ -115,7 +115,7 @@ export const router = createHashRouter([
},
{
- path: "orders",
+ path: "orders/:orderId?",
element: (