Merge remote-tracking branch 'origin/main'
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { Card, Divider, Space, Layout, Button } from "antd";
|
||||
import { Card, Divider, Space, Layout, Button, Popconfirm } from "antd";
|
||||
import ArabicPrice from "components/ArabicPrice";
|
||||
import CartActionsButtons from "components/CartActionsButtons/CartActionsButtons.tsx";
|
||||
import ImageWithFallback from "components/ImageWithFallback";
|
||||
@@ -101,27 +101,36 @@ export default function CartMobileTabletLayout({
|
||||
</ProTitle>
|
||||
</div>
|
||||
|
||||
<Button
|
||||
shape="circle"
|
||||
iconPlacement="start"
|
||||
icon={
|
||||
<DeleteIcon
|
||||
className={styles.deleteIcon}
|
||||
color={"#C0BFC4"}
|
||||
dimension={16}
|
||||
/>
|
||||
}
|
||||
size="small"
|
||||
className={styles.addButton}
|
||||
style={{
|
||||
width: 32,
|
||||
height: 32,
|
||||
border: "1px solid #DEDEE0",
|
||||
}}
|
||||
onClick={() => {
|
||||
<Popconfirm
|
||||
title={t("cart.clearCartConfirmation.title")}
|
||||
description={t("cart.clearCartConfirmation.content")}
|
||||
onConfirm={() => {
|
||||
dispatch(clearCart());
|
||||
}}
|
||||
/>
|
||||
okText={t("cart.clearCartConfirmation.confirm")}
|
||||
cancelText={t("cart.clearCartConfirmation.cancel")}
|
||||
okButtonProps={{ danger: true }}
|
||||
placement={isRTL ? "left" : "right"}
|
||||
>
|
||||
<Button
|
||||
shape="circle"
|
||||
iconPlacement="start"
|
||||
icon={
|
||||
<DeleteIcon
|
||||
className={styles.deleteIcon}
|
||||
color={"#C0BFC4"}
|
||||
dimension={16}
|
||||
/>
|
||||
}
|
||||
size="small"
|
||||
className={styles.addButton}
|
||||
style={{
|
||||
width: 32,
|
||||
height: 32,
|
||||
border: "1px solid #DEDEE0",
|
||||
}}
|
||||
/>
|
||||
</Popconfirm>
|
||||
</div>
|
||||
|
||||
{items.length >= 1 && (
|
||||
|
||||
@@ -126,9 +126,9 @@ export default function CheckoutPage() {
|
||||
)}
|
||||
|
||||
{/* Reward Your Waiter */}
|
||||
{orderType !== OrderType.Redeem && orderType !== OrderType.Gift && (
|
||||
{/* {orderType !== OrderType.Redeem && orderType !== OrderType.Gift && (
|
||||
<RewardWaiterCard />
|
||||
)}
|
||||
)} */}
|
||||
{orderType !== OrderType.Redeem && orderType !== OrderType.Gift && (
|
||||
<EarnLoyaltyPointsCard />
|
||||
)}
|
||||
|
||||
@@ -1,15 +1,21 @@
|
||||
import { Button } from "antd";
|
||||
import BackIcon from "components/Icons/BackIcon";
|
||||
import NextIcon from "components/Icons/NextIcon";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
import { useAppSelector } from "redux/hooks";
|
||||
|
||||
interface BackButtonProps {
|
||||
navigateBack?: boolean; // true = use router.back(), false = just clear state
|
||||
customRoute?: string;
|
||||
}
|
||||
|
||||
export default function BackButton({ navigateBack = true }: BackButtonProps) {
|
||||
export default function BackButton({ customRoute }: BackButtonProps) {
|
||||
const router = useNavigate();
|
||||
const handleBack = () => {
|
||||
if (navigateBack) window.history.back();
|
||||
if (customRoute) {
|
||||
router(customRoute);
|
||||
} else {
|
||||
router(-1);
|
||||
}
|
||||
};
|
||||
const { isRTL } = useAppSelector((state) => state.locale);
|
||||
|
||||
|
||||
@@ -38,6 +38,7 @@ function MenuPage() {
|
||||
const { subdomain } = useParams();
|
||||
const { isRTL } = useAppSelector((state) => state.locale);
|
||||
const { orderType } = useAppSelector((state) => state.order);
|
||||
const { token } = useAppSelector((state) => state.auth);
|
||||
const { t } = useTranslation();
|
||||
const { data: restaurant, isLoading: isLoadingRestaurant } =
|
||||
useGetRestaurantDetailsQuery(subdomain, {
|
||||
@@ -91,7 +92,9 @@ function MenuPage() {
|
||||
<div
|
||||
className={`${styles.headerFloatingBtn} ${styles.backButtonContainer}`}
|
||||
>
|
||||
<BackButton />
|
||||
<BackButton
|
||||
{...(token ? { customRoute: `/${subdomain}` } : {})}
|
||||
/>
|
||||
</div>
|
||||
<div
|
||||
className={`${styles.headerFloatingBtn} ${styles.orderTypeSelectContainer} order-type-select-container`}
|
||||
|
||||
Reference in New Issue
Block a user