diff --git a/src/components/Ads/Ads1.module.css b/src/components/Ads/Ads1.module.css index a043268..cd27ad9 100644 --- a/src/components/Ads/Ads1.module.css +++ b/src/components/Ads/Ads1.module.css @@ -44,11 +44,11 @@ } :global(.darkApp) .rightRectangle { - right: 0px; + right: 16px; } :global(.darkApp) .leftRectangle { - left: 0px; + left: 16px; } .adsCard { diff --git a/src/components/FloatingButton/FloatingButton.tsx b/src/components/FloatingButton/FloatingButton.tsx index dae90b5..42d2516 100644 --- a/src/components/FloatingButton/FloatingButton.tsx +++ b/src/components/FloatingButton/FloatingButton.tsx @@ -1,18 +1,16 @@ -import { Button, Grid } from "antd"; +import { Button } from "antd"; import TopIcon from "components/Icons/TopIcon"; import { useScrollHandler } from "contexts/ScrollHandlerContext"; +import useBreakPoint from "hooks/useBreakPoint"; import { useCallback } from "react"; import { useAppSelector } from "redux/hooks"; import { colors } from "ThemeConstants"; import styles from "./FloatingButton.module.css"; -const { useBreakpoint } = Grid; - export function FloatingButton() { const { isRTL } = useAppSelector((state) => state.locale); const { themeName } = useAppSelector((state) => state.theme); - const { xs } = useBreakpoint(); - const isMobile = xs; + const { isMobile, isTablet } = useBreakPoint(); const { showScrollTop } = useScrollHandler(); @@ -36,12 +34,13 @@ export function FloatingButton() { className={`${styles.scrollToTopButton}`} style={{ position: "fixed", - bottom: isMobile ? "100px" : "120px", + bottom: isMobile ? "100px" : isTablet ? "120px" : "25px", right: isRTL ? "auto" : isMobile ? "20px" : "32px", left: isRTL ? (isMobile ? "20px" : "32px") : "auto", zIndex: 1000, boxShadow: "0 4px 12px rgba(0, 0, 0, 0.15)", - backgroundColor: themeName === "dark" ? colors.primary : colors.primary, + backgroundColor: + themeName === "dark" ? colors.primary : colors.primary, borderColor: themeName === "dark" ? colors.primary : colors.primary, width: isMobile ? 48 : 56, height: isMobile ? 48 : 56, diff --git a/src/components/Icons/item/DescIcon1.tsx b/src/components/Icons/item/DescIcon1.tsx index c672de8..00713db 100644 --- a/src/components/Icons/item/DescIcon1.tsx +++ b/src/components/Icons/item/DescIcon1.tsx @@ -6,8 +6,8 @@ interface DescIcon1Type { const DescIcon1 = ({ className, onClick }: DescIcon1Type) => { return ( { return ( { return ( state.locale); + const { themeName } = useAppSelector((state) => state.theme); + const { isMobile, isTablet } = useBreakPoint(); + const { id } = useParams(); + const navigate = useNavigate(); + const items = useAppSelector(selectCartItems); + + const onCartClick = useCallback(() => { + navigate(`/${id}/cart`); + }, [navigate, id]); + + const totalItems = items.reduce((sum, item) => sum + item.quantity, 0); + + return ( + <> + + + ); +} diff --git a/src/pages/menu/components/MenuFooter/MenuFooter.tsx b/src/pages/menu/components/MenuFooter/MenuFooter.tsx index cd2e6e8..efbe5e4 100644 --- a/src/pages/menu/components/MenuFooter/MenuFooter.tsx +++ b/src/pages/menu/components/MenuFooter/MenuFooter.tsx @@ -1,21 +1,18 @@ -import { Badge, Button, Grid } from "antd"; +import { Badge, Button } from "antd"; import CartIcon from "components/Icons/cart/CartIcon"; import ProText from "components/ProText"; import { selectCartItems } from "features/order/orderSlice"; +import useBreakPoint from "hooks/useBreakPoint"; import { useTranslation } from "react-i18next"; import { Link } from "react-router-dom"; import { useAppSelector } from "redux/hooks"; import { colors, ProBlack2 } from "ThemeConstants"; -const { useBreakpoint } = Grid; - export function MenuFooter() { const items = useAppSelector(selectCartItems); const restaurantName = localStorage.getItem("restaurantName"); const { themeName } = useAppSelector((state) => state.theme); - const { xs, sm } = useBreakpoint(); - const isMobile = xs; - const isTablet = sm && !xs; + const { isMobile, isTablet } = useBreakPoint(); const { t } = useTranslation(); const totalItems = items.reduce((sum, item) => sum + item.quantity, 0); @@ -30,7 +27,7 @@ export function MenuFooter() { position: "fixed", bottom: 0, left: 0, - height: "10vh", + height: "80px", display: "flex", flexDirection: "row", justifyContent: "space-around", @@ -51,8 +48,7 @@ export function MenuFooter() { shape="round" style={{ width: "100%", - height: 48, - marginBottom: 16, + height: 50, boxShadow: "none", }} > diff --git a/src/pages/menu/components/MenuList/MenuList.tsx b/src/pages/menu/components/MenuList/MenuList.tsx index 01e47df..f7b493f 100644 --- a/src/pages/menu/components/MenuList/MenuList.tsx +++ b/src/pages/menu/components/MenuList/MenuList.tsx @@ -157,7 +157,7 @@ export function MenuList({ data, categoryRefs }: MenuListProps) { style={{ margin: 0, display: "inline-block", - fontSize: xs ? "1rem" : 18, + fontSize: "1rem" , fontWeight: 600, letterSpacing: "-0.01em", lineHeight: 1.2, @@ -194,7 +194,7 @@ export function MenuList({ data, categoryRefs }: MenuListProps) { price={item.original_price} strong style={{ - fontSize: xs ? "1rem" : 22, + fontSize: "1rem", fontWeight: 700, color: colors.primary, textDecoration: "line-through", @@ -207,7 +207,7 @@ export function MenuList({ data, categoryRefs }: MenuListProps) { price={item.price} strong style={{ - fontSize: xs ? "1rem" : 22, + fontSize: "1rem", fontWeight: 700, color: colors.primary, }} diff --git a/src/pages/menu/components/MenuSkeleton/MenuSkeleton.tsx b/src/pages/menu/components/MenuSkeleton/MenuSkeleton.tsx index b514d7f..dd49f53 100644 --- a/src/pages/menu/components/MenuSkeleton/MenuSkeleton.tsx +++ b/src/pages/menu/components/MenuSkeleton/MenuSkeleton.tsx @@ -212,6 +212,7 @@ const MenuSkeleton = ({ width: "32px", height: "32px", borderRadius: "50%", + overflow: "hidden", }} /> ))} diff --git a/src/pages/menu/menu.module.css b/src/pages/menu/menu.module.css index 79b3592..50955c9 100644 --- a/src/pages/menu/menu.module.css +++ b/src/pages/menu/menu.module.css @@ -449,7 +449,6 @@ } .contentWrapper { - max-width: 800px; margin: 0px auto; padding: 0 1rem; } @@ -546,12 +545,12 @@ } .leftShape { - top: 170px; + top: 171px; left: -3px; } .rightShape { - top: 170px; + top: 171px; left: 116px; } @@ -615,12 +614,12 @@ } .leftShape { - top: 170px; + top: 171px; left: -10px; } .rightShape { - top: 170px; + top: 171px; left: 179px; } } diff --git a/src/pages/menu/page.tsx b/src/pages/menu/page.tsx index 4457ea6..f35288c 100644 --- a/src/pages/menu/page.tsx +++ b/src/pages/menu/page.tsx @@ -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() { -
- - {/* Placeholder to prevent content jumping when categories become sticky */} - {/* {isCategoriesSticky && ( -
- )} */} - +
+
@@ -156,6 +140,7 @@ function MenuPage() { + {isDesktop && }
)} diff --git a/src/pages/split-bill/page.tsx b/src/pages/split-bill/page.tsx index 0875631..731aab1 100644 --- a/src/pages/split-bill/page.tsx +++ b/src/pages/split-bill/page.tsx @@ -120,7 +120,7 @@ export default function SplitBillPage() { position: "fixed", bottom: 0, left: 0, - height: "10vh", + height: "80px", display: "flex", flexDirection: "row", justifyContent: "space-around",