refactor the use of plain string order types
This commit is contained in:
@@ -7,11 +7,12 @@ import { useMemo } from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useAppSelector } from "redux/hooks";
|
||||
import styles from "../../address/address.module.css";
|
||||
import { OrderType } from "pages/checkout/hooks/types.ts";
|
||||
|
||||
export default function BriefMenu() {
|
||||
const { tables, items } = useAppSelector(selectCart);
|
||||
const { t } = useTranslation();
|
||||
const { orderType } = useAppSelector(selectCart)
|
||||
const { orderType } = useAppSelector(selectCart);
|
||||
|
||||
const menuItems = useMemo(
|
||||
() =>
|
||||
@@ -28,23 +29,20 @@ export default function BriefMenu() {
|
||||
<div>
|
||||
<ProText className={styles.itemName}>{item.name}</ProText>
|
||||
<br />
|
||||
<ArabicPrice
|
||||
price={item.price}
|
||||
type="secondary"
|
||||
/>
|
||||
<ArabicPrice price={item.price} type="secondary" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)),
|
||||
[items]
|
||||
[items],
|
||||
);
|
||||
|
||||
const cardTitle = useMemo(
|
||||
() =>
|
||||
orderType === "dine-in"
|
||||
orderType === OrderType.DineIn
|
||||
? t("checkout.table") + " " + tables
|
||||
: t("checkout.items"),
|
||||
[orderType, t, tables]
|
||||
[orderType, t, tables],
|
||||
);
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user