import { StarFilled } from "@ant-design/icons"; import { Image, Space } from "antd"; import { FloatingButton } from "components/FloatingButton/FloatingButton"; import ImageWithFallback from "components/ImageWithFallback"; import LoyaltyCard from "components/LoyaltyCard/LoyaltyCard"; import ProText from "components/ProText"; import ProTitle from "components/ProTitle"; import { useScrollHandler } from "contexts/ScrollHandlerContext"; import useBreakPoint from "hooks/useBreakPoint"; import { useTranslation } from "react-i18next"; import { useParams } from "react-router-dom"; import { useGetMenuQuery, useGetRestaurantDetailsQuery, } from "redux/api/others"; import { useAppSelector } from "redux/hooks"; import { default_image } from "utils/constants"; import BackButton from "./components/BackButton"; import { CartButton } from "./components/CartButton/CartButton"; import { CategoriesList } from "./components/CategoriesList/CategoriesList"; import LocalStorageHandler from "./components/LocalStorageHandler"; import { MenuFooter } from "./components/MenuFooter/MenuFooter"; import { MenuList } from "./components/MenuList/MenuList"; import MenuSkeleton from "./components/MenuSkeleton/MenuSkeleton"; import ScrollEventHandler from "./components/ScrollEventHandler"; import SearchButton from "./components/SearchButton"; import styles from "./menu.module.css"; function MenuPage() { const { id } = useParams(); const { isRTL } = useAppSelector((state) => state.locale); const { t } = useTranslation(); const { data: restaurant, isLoading: isLoadingRestaurant } = useGetRestaurantDetailsQuery("595", { skip: !id, }); const { data: menuData, isLoading: isLoadingMenu } = useGetMenuQuery( restaurant?.restautantId, { skip: !restaurant?.restautantId, }, ); const { categoryRefs } = useScrollHandler(); const { isMobile, isTablet, isDesktop } = useBreakPoint(); const isLoading = isLoadingRestaurant || isLoadingMenu; return ( <> {isLoading ? ( ) : (
{t("menu.restaurantLogo")}
{/* */}
{isRTL ? restaurant?.nameAR : restaurant?.restautantName}
4.5 (2567) {isRTL ? restaurant?.descriptionAR : restaurant?.description}
{restaurant?.loyalty_stamps && restaurant?.is_loyalty_enabled && }
{isDesktop && }
)} ); } export default MenuPage;