refactor the use of plain string order types

This commit is contained in:
2025-10-28 13:29:52 +03:00
parent 7aa686166b
commit 1abb63e8bd
16 changed files with 73 additions and 58 deletions

View File

@@ -30,6 +30,7 @@ import SpecialRequestCard from "pages/cart/components/specialRequest/SpecialRequ
import TableNumberCard from "pages/cart/components/TableNumberCard.tsx";
import TimeEstimateCard from "pages/cart/components/timeEstimate/TimeEstimateCard.tsx";
import { useTranslation } from "react-i18next";
import { OrderType } from "pages/checkout/hooks/types";
interface CartMobileTabletLayoutProps {
form: FormInstance;
@@ -224,15 +225,14 @@ export default function CartMobileTabletLayout({
<CouponCard />
{/* Car Plate*/}
{orderType === "pickup" && <CarPlateCard />}
{orderType === OrderType.Pickup && <CarPlateCard />}
{/* Estimate Time */}
{(orderType === "delivery" || orderType === "pickup") && (
<TimeEstimateCard />
)}
{(orderType === OrderType.Delivery ||
orderType === OrderType.Pickup) && <TimeEstimateCard />}
{/* Collection Method */}
{orderType === "pickup" && (
{orderType === OrderType.Pickup && (
<ProInputCard title={t("cart.collectionMethod")}>
<Form.Item
name="collectionMethod"
@@ -270,7 +270,7 @@ export default function CartMobileTabletLayout({
<RewardWaiterCard />
{/* Table Number */}
{orderType === "dine-in" && <TableNumberCard />}
{orderType === OrderType.DineIn && <TableNumberCard />}
{/* Invoice Summary */}
<OrderSummary />