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 && ( - )}