update logic

This commit is contained in:
2025-12-25 23:51:01 +03:00
parent 4bf18087cc
commit a87d1d7716
2 changed files with 5 additions and 7 deletions

View File

@@ -2,9 +2,9 @@ import { Button } from "antd";
import { useTranslation } from "react-i18next";
import { ProBottomSheet } from "../ProBottomSheet/ProBottomSheet";
import NextIcon from "components/Icons/NextIcon";
import { useAppSelector, useAppDispatch } from "redux/hooks";
import { updateOrderType } from "features/order/orderSlice";
import { useAppSelector } from "redux/hooks";
import { OrderType } from "pages/checkout/hooks/types";
import { useSearchParams } from "react-router-dom";
interface OrderTypesBottomSheetBottomSheetProps {
isOpen: boolean;
@@ -16,11 +16,10 @@ export function OrderTypesBottomSheet({
onClose,
}: OrderTypesBottomSheetBottomSheetProps) {
const { t } = useTranslation();
const dispatch = useAppDispatch();
const { restaurant, orderType, hiddenServices } = useAppSelector(
(state) => state.order,
);
const [searchParams, setSearchParams] = useSearchParams();
const buttonStyle = {
height: 48,
width: "100%",
@@ -33,7 +32,8 @@ export function OrderTypesBottomSheet({
const calculatedHeight = 620 - hiddenServices * 64;
const handleOrderTypeSelect = (selectedOrderType: OrderType) => {
dispatch(updateOrderType(selectedOrderType));
searchParams.set("orderType", selectedOrderType);
setSearchParams(searchParams);
onClose();
};

View File

@@ -24,8 +24,6 @@ export function MenuFooter() {
const grandTotal = useAppSelector(selectGrandTotal);
const { isRTL } = useAppSelector((state) => state.locale);
console.log(orderType);
return (
<>
{(isMobile || isTablet) && (