refactor the use of plain string order types
This commit is contained in:
@@ -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 />
|
||||
|
||||
Reference in New Issue
Block a user