From 611f26f6ff951924e4fce5f82bf9fe3ebb7b3cd2 Mon Sep 17 00:00:00 2001 From: Mohammed Al-yaseen Date: Thu, 25 Dec 2025 22:52:57 +0300 Subject: [PATCH] OrderTypesBottomSheet: add change order type logic --- .../OrderTypesBottomSheet.tsx | 80 ++++++++++++++++--- 1 file changed, 69 insertions(+), 11 deletions(-) diff --git a/src/components/CustomBottomSheet/OrderTypesBottomSheet.tsx b/src/components/CustomBottomSheet/OrderTypesBottomSheet.tsx index efca66f..929d494 100644 --- a/src/components/CustomBottomSheet/OrderTypesBottomSheet.tsx +++ b/src/components/CustomBottomSheet/OrderTypesBottomSheet.tsx @@ -2,7 +2,9 @@ import { Button } from "antd"; import { useTranslation } from "react-i18next"; import { ProBottomSheet } from "../ProBottomSheet/ProBottomSheet"; import NextIcon from "components/Icons/NextIcon"; -import { useAppSelector } from "redux/hooks"; +import { useAppSelector, useAppDispatch } from "redux/hooks"; +import { updateOrderType } from "features/order/orderSlice"; +import { OrderType } from "pages/checkout/hooks/types"; interface OrderTypesBottomSheetBottomSheetProps { isOpen: boolean; @@ -14,7 +16,8 @@ export function OrderTypesBottomSheet({ onClose, }: OrderTypesBottomSheetBottomSheetProps) { const { t } = useTranslation(); - const { restaurant } = useAppSelector((state) => state.order); + const dispatch = useAppDispatch(); + const { restaurant, orderType } = useAppSelector((state) => state.order); const buttonStyle = { height: 48, @@ -41,6 +44,11 @@ export function OrderTypesBottomSheet({ const hiddenServices = totalServices - visibleServicesCount; const calculatedHeight = 620 - hiddenServices * 64; + const handleOrderTypeSelect = (selectedOrderType: OrderType) => { + dispatch(updateOrderType(selectedOrderType)); + onClose(); + }; + return ( {restaurant?.dineIn == true && ( - )} {restaurant?.delivery == true && ( - )} {restaurant?.pickup == true && ( - )} {restaurant?.gift == true && ( - )} {restaurant?.toRoom == true && ( - )} {restaurant?.toOffice == true && ( - )} {restaurant?.is_schedule_order_enabled == 1 && ( - )} {restaurant?.is_booking_enabled == 1 && ( - )}