diff --git a/src/assets/locals/ar.json b/src/assets/locals/ar.json index 0b55f19..d8af1f4 100644 --- a/src/assets/locals/ar.json +++ b/src/assets/locals/ar.json @@ -108,6 +108,7 @@ "email_label": "البريد الإلكتروني" }, "menu": { + "orderTypes": "طرق الطلب", "meal": "الوجبة", "title": "القائمة", "ourMenu": "قائمتنا", diff --git a/src/assets/locals/en.json b/src/assets/locals/en.json index a9fd4aa..da9cbd3 100644 --- a/src/assets/locals/en.json +++ b/src/assets/locals/en.json @@ -124,6 +124,7 @@ "email_label": "Email" }, "menu": { + "orderTypes": "Order Types", "meal": "Meal", "title": "Menu", "ourMenu": "Our Menu", diff --git a/src/components/CustomBottomSheet/OrderTypesBottomSheet.tsx b/src/components/CustomBottomSheet/OrderTypesBottomSheet.tsx new file mode 100644 index 0000000..efca66f --- /dev/null +++ b/src/components/CustomBottomSheet/OrderTypesBottomSheet.tsx @@ -0,0 +1,105 @@ +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"; + +interface OrderTypesBottomSheetBottomSheetProps { + isOpen: boolean; + onClose: () => void; +} + +export function OrderTypesBottomSheet({ + isOpen, + onClose, +}: OrderTypesBottomSheetBottomSheetProps) { + const { t } = useTranslation(); + const { restaurant } = useAppSelector((state) => state.order); + + const buttonStyle = { + height: 48, + width: "100%", + display: "flex", + justifyContent: "space-between", + alignItems: "center", + }; + + // Count visible services + const visibleServicesCount = [ + 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, + ].filter(Boolean).length; + + // Calculate height: base 620px, subtract 48px for each hidden service + const totalServices = 8; + const hiddenServices = totalServices - visibleServicesCount; + const calculatedHeight = 620 - hiddenServices * 64; + + 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 && ( + + )} +
+
+ ); +} diff --git a/src/pages/menu/components/CategoriesList/CategoriesList.tsx b/src/pages/menu/components/CategoriesList/CategoriesList.tsx index 8f1f4fb..a589a2e 100644 --- a/src/pages/menu/components/CategoriesList/CategoriesList.tsx +++ b/src/pages/menu/components/CategoriesList/CategoriesList.tsx @@ -189,7 +189,10 @@ export function CategoriesList({ categories }: CategoriesListProps) { data-category-id={category.id} style={{ borderRadius: 8, - border: "none", + borderTop: "none", + borderRight: "none", + borderBottom: "none", + borderLeft: "none", backgroundColor: isCategoriesSticky ? "transparent" : "var(--background)", }} styles={{ @@ -232,7 +235,7 @@ export function CategoriesList({ categories }: CategoriesListProps) { )} state.locale); const { orderType } = useAppSelector((state) => state.order); const { t } = useTranslation(); @@ -55,6 +54,7 @@ function MenuPage() { const { isMobile, isTablet, isDesktop } = useBreakPoint(); const isLoading = isLoadingRestaurant || isLoadingMenu; const [isOpeningTimesOpen, setIsOpeningTimesOpen] = useState(false); + const [isOrderTypesOpen, setIsOrderTypesOpen] = useState(false); const orderTypeOptions = enumToSelectOptions(OrderType, t, "orderTypes"); // Automatically load restaurant taxes when restaurant data is available @@ -99,16 +99,18 @@ function MenuPage() { >