refactor the use of plain string order types
This commit is contained in:
@@ -6,10 +6,11 @@ import { useNavigate, useParams } from "react-router-dom";
|
||||
import { useAppSelector } from "redux/hooks";
|
||||
import styles from "../../address/address.module.css";
|
||||
import useOrder from "../hooks/useOrder";
|
||||
import { OrderType } from "pages/checkout/hooks/types.ts";
|
||||
|
||||
export default function CheckoutButton({ form }: { form: FormInstance }) {
|
||||
const { t } = useTranslation();
|
||||
const { orderType } = useAppSelector(selectCart)
|
||||
const { orderType } = useAppSelector(selectCart);
|
||||
const navigate = useNavigate();
|
||||
const { handleCreateOrder } = useOrder();
|
||||
const { id } = useParams();
|
||||
@@ -28,7 +29,7 @@ export default function CheckoutButton({ form }: { form: FormInstance }) {
|
||||
}, [handleCreateOrder, form]);
|
||||
|
||||
const shouldShowSplitBill = useMemo(
|
||||
() => orderType === "dine-in",
|
||||
() => orderType === OrderType.DineIn,
|
||||
[orderType],
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user