fixes
- apply fixed height for footer buttons over app - add floating cart button in cart page in desktop size
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
import { StarFilled } from "@ant-design/icons";
|
||||
import { Grid, Image, Space } from "antd";
|
||||
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, useSearchParams } from "react-router-dom";
|
||||
import {
|
||||
@@ -15,6 +16,7 @@ import {
|
||||
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";
|
||||
@@ -24,8 +26,6 @@ import ScrollEventHandler from "./components/ScrollEventHandler";
|
||||
import SearchButton from "./components/SearchButton";
|
||||
import styles from "./menu.module.css";
|
||||
|
||||
const { useBreakpoint } = Grid;
|
||||
|
||||
function MenuPage() {
|
||||
const { id } = useParams();
|
||||
const [searchParams] = useSearchParams();
|
||||
@@ -44,8 +44,7 @@ function MenuPage() {
|
||||
},
|
||||
);
|
||||
const { categoryRefs } = useScrollHandler();
|
||||
const { xs, md } = useBreakpoint();
|
||||
const isTablet = !xs && !md;
|
||||
const { isMobile, isTablet, isDesktop } = useBreakPoint();
|
||||
|
||||
const isLoading = isLoadingRestaurant || isLoadingMenu;
|
||||
|
||||
@@ -68,7 +67,7 @@ function MenuPage() {
|
||||
alt={t("menu.restaurantCover")}
|
||||
className={styles.cover}
|
||||
width={"100%"}
|
||||
height={xs ? 182 : isTablet ? 200 : 220}
|
||||
height={isMobile ? 182 : isTablet ? 200 : 220}
|
||||
preview={false}
|
||||
loadingContainerStyle={{
|
||||
width: "100vw",
|
||||
@@ -122,23 +121,8 @@ function MenuPage() {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div
|
||||
className={`${styles.pageContainer}`}
|
||||
// style={{
|
||||
// maxWidth: isDesktop ? "1200px" : "100%",
|
||||
// margin: isDesktop ? "0 auto" : "0",
|
||||
// }}
|
||||
>
|
||||
<Space
|
||||
direction="vertical"
|
||||
// size={isMobile ? "middle" : isTablet ? "large" : "large"}
|
||||
style={{ width: "100%", gap: 16 }}
|
||||
>
|
||||
{/* Placeholder to prevent content jumping when categories become sticky */}
|
||||
{/* {isCategoriesSticky && (
|
||||
<div style={{ height: xs ? 95 : md ? 160 : 180 }} />
|
||||
)} */}
|
||||
|
||||
<div className={`${styles.pageContainer}`}>
|
||||
<Space direction="vertical" style={{ width: "100%", gap: 16 }}>
|
||||
<div>
|
||||
<LoyaltyCard />
|
||||
<CategoriesList categories={menuData?.categories || []} />
|
||||
@@ -156,6 +140,7 @@ function MenuPage() {
|
||||
|
||||
<ScrollEventHandler />
|
||||
<FloatingButton />
|
||||
{isDesktop && <CartButton />}
|
||||
</div>
|
||||
)}
|
||||
</>
|
||||
|
||||
Reference in New Issue
Block a user