update logic
This commit is contained in:
@@ -2,9 +2,9 @@ import { Button } from "antd";
|
|||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { ProBottomSheet } from "../ProBottomSheet/ProBottomSheet";
|
import { ProBottomSheet } from "../ProBottomSheet/ProBottomSheet";
|
||||||
import NextIcon from "components/Icons/NextIcon";
|
import NextIcon from "components/Icons/NextIcon";
|
||||||
import { useAppSelector, useAppDispatch } from "redux/hooks";
|
import { useAppSelector } from "redux/hooks";
|
||||||
import { updateOrderType } from "features/order/orderSlice";
|
|
||||||
import { OrderType } from "pages/checkout/hooks/types";
|
import { OrderType } from "pages/checkout/hooks/types";
|
||||||
|
import { useSearchParams } from "react-router-dom";
|
||||||
|
|
||||||
interface OrderTypesBottomSheetBottomSheetProps {
|
interface OrderTypesBottomSheetBottomSheetProps {
|
||||||
isOpen: boolean;
|
isOpen: boolean;
|
||||||
@@ -16,11 +16,10 @@ export function OrderTypesBottomSheet({
|
|||||||
onClose,
|
onClose,
|
||||||
}: OrderTypesBottomSheetBottomSheetProps) {
|
}: OrderTypesBottomSheetBottomSheetProps) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const dispatch = useAppDispatch();
|
|
||||||
const { restaurant, orderType, hiddenServices } = useAppSelector(
|
const { restaurant, orderType, hiddenServices } = useAppSelector(
|
||||||
(state) => state.order,
|
(state) => state.order,
|
||||||
);
|
);
|
||||||
|
const [searchParams, setSearchParams] = useSearchParams();
|
||||||
const buttonStyle = {
|
const buttonStyle = {
|
||||||
height: 48,
|
height: 48,
|
||||||
width: "100%",
|
width: "100%",
|
||||||
@@ -33,7 +32,8 @@ export function OrderTypesBottomSheet({
|
|||||||
const calculatedHeight = 620 - hiddenServices * 64;
|
const calculatedHeight = 620 - hiddenServices * 64;
|
||||||
|
|
||||||
const handleOrderTypeSelect = (selectedOrderType: OrderType) => {
|
const handleOrderTypeSelect = (selectedOrderType: OrderType) => {
|
||||||
dispatch(updateOrderType(selectedOrderType));
|
searchParams.set("orderType", selectedOrderType);
|
||||||
|
setSearchParams(searchParams);
|
||||||
onClose();
|
onClose();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -24,8 +24,6 @@ export function MenuFooter() {
|
|||||||
const grandTotal = useAppSelector(selectGrandTotal);
|
const grandTotal = useAppSelector(selectGrandTotal);
|
||||||
const { isRTL } = useAppSelector((state) => state.locale);
|
const { isRTL } = useAppSelector((state) => state.locale);
|
||||||
|
|
||||||
console.log(orderType);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{(isMobile || isTablet) && (
|
{(isMobile || isTablet) && (
|
||||||
|
|||||||
Reference in New Issue
Block a user