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

@@ -22,6 +22,7 @@ import YouMightAlsoLike from "pages/cart/components/youMayLike/YouMightAlsoLike.
import { useTranslation } from "react-i18next";
import { useAppSelector } from "redux/hooks.ts";
import CartFooter from "./cartFooter/CartFooter";
import { OrderType } from "pages/checkout/hooks/types.ts";
interface CartDesktopLayoutProps {
form: FormInstance;
@@ -177,11 +178,10 @@ export default function CartDesktopLayout({ form }: CartDesktopLayoutProps) {
<CouponCard />
</div>
{orderType === "pickup" && <CarPlateCard />}
{orderType === OrderType.Pickup && <CarPlateCard />}
{(orderType === "delivery" || orderType === "pickup") && (
<TimeEstimateCard />
)}
{(orderType === OrderType.Delivery ||
orderType === OrderType.Pickup) && <TimeEstimateCard />}
<div
className={styles.desktopSidebarCard}
@@ -191,7 +191,7 @@ export default function CartDesktopLayout({ form }: CartDesktopLayoutProps) {
</div>
{/* Table Number */}
{orderType === "dine-in" && (
{orderType === OrderType.DineIn && (
<div
className={styles.desktopSidebarCard}
style={{ "--animation-order": 3 } as React.CSSProperties}