add order details & enhance the checkout page

This commit is contained in:
2025-12-31 00:57:05 +03:00
parent 7119ead8c2
commit 38c83d5143
15 changed files with 623 additions and 22 deletions

View File

@@ -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`);
}
}}
>
<ProText