From b385d409134eff12585548832e9385fd20f689ff Mon Sep 17 00:00:00 2001 From: Mohammed Al-yaseen Date: Mon, 6 Oct 2025 01:44:09 +0300 Subject: [PATCH] MenuSkeleton: fix desktop size --- .../MenuSkeleton/MenuSkeleton.module.css | 44 +- .../components/MenuSkeleton/MenuSkeleton.tsx | 459 +++++++++--------- 2 files changed, 267 insertions(+), 236 deletions(-) diff --git a/src/pages/menu/components/MenuSkeleton/MenuSkeleton.module.css b/src/pages/menu/components/MenuSkeleton/MenuSkeleton.module.css index e50b2e4..50f3e2f 100644 --- a/src/pages/menu/components/MenuSkeleton/MenuSkeleton.module.css +++ b/src/pages/menu/components/MenuSkeleton/MenuSkeleton.module.css @@ -18,6 +18,24 @@ gap: 16px; } +.cover { + width: 100%; + height: "auto"; + object-fit: cover; +} + +.logo { + position: absolute; + left: 33px; + top: -64px; + width: 72px; + height: 72px; + border-radius: 50%; + border: 3px solid var(--background); + z-index: 10; + overflow: hidden; +} + .leftShape { position: absolute; top: 133px; @@ -49,6 +67,12 @@ /* Enhanced responsive categories container */ @media (min-width: 769px) and (max-width: 1024px) { + .logo { + left: 40px; + width: 80px; + height: 80px; + } + .categoriesContainer { height: 160px; padding: 0 24px; @@ -65,17 +89,23 @@ } .leftShape { - top: 170px; + top: 150px; left: -3px; } .rightShape { - top: 170px; + top: 150px; left: 116px; } } @media (min-width: 1025px) { + .logo { + left: 33px; + top: 141px; + width: 150px !important; + height: 150px !important; + } .categoriesContainer { height: 180px; padding: 0 24px; @@ -94,6 +124,16 @@ max-width: 100vw !important; margin: 0 !important; } + + .leftShape { + top: 170px; + left: -10px; + } + + .rightShape { + top: 170px; + left: 185px; + } } .menuSection:first-child h3 { diff --git a/src/pages/menu/components/MenuSkeleton/MenuSkeleton.tsx b/src/pages/menu/components/MenuSkeleton/MenuSkeleton.tsx index 951ed6d..b514d7f 100644 --- a/src/pages/menu/components/MenuSkeleton/MenuSkeleton.tsx +++ b/src/pages/menu/components/MenuSkeleton/MenuSkeleton.tsx @@ -1,4 +1,5 @@ -import { Card, Grid, Skeleton } from "antd"; +import { Card, Skeleton } from "antd"; +import useBreakPoint from "hooks/useBreakPoint"; import styles from "./MenuSkeleton.module.css"; interface MenuSkeletonProps { @@ -12,17 +13,12 @@ interface MenuSkeletonProps { | "menu-only"; } -const { useBreakpoint } = Grid; - const MenuSkeleton = ({ - categoryCount = 6, + categoryCount = 8, itemCount = 8, variant = "default", }: MenuSkeletonProps) => { - const { xs, md } = useBreakpoint(); - const isMobile = xs; - const isTablet = !xs && !md; - // const isDesktop = md; + const { isMobile, isTablet } = useBreakPoint(); const getCategoryCardStyle = () => { if (isMobile) { @@ -106,82 +102,90 @@ const MenuSkeleton = ({ } }; - const getGridClass = () => { - if (isMobile) { - return styles.menuItemsGridMobile; - } else if (isTablet) { - return styles.menuItemsGridTablet; - } else { - return styles.menuItemsGridDesktop; - } - }; - return ( -
+ <> {/* Restaurant Header Skeleton */}
{/* Cover Image Skeleton */} - {/* Logo Skeleton */} - {/* Decorative Shapes Skeleton */} + {/* Decorative Shap es Skeleton */}
- - {/* Restaurant Info Skeleton */} -
-
- -
-
- - {/* Loyalty Card Skeleton */} -
- +
+ {/* Restaurant Info Skeleton */} +
-
+ +
+
+ + {/* Loyalty Card Skeleton */} +
+ +
+
+ + +
- +
+
+
+ {Array.from({ length: 5 }).map((_, index) => ( + + ))} +
+
- -
-
+
+
+ + {/* Categories Skeleton */} + {(variant === "default" || + variant === "minimal" || + variant === "detailed" || + variant === "categories-only") && (
-
- {Array.from({ length: 5 }).map((_, index) => ( - - ))} -
- -
- -
- - {/* Categories Skeleton */} - {(variant === "default" || - variant === "minimal" || - variant === "detailed" || - variant === "categories-only") && ( -
- {Array.from({ - length: - variant === "minimal" - ? Math.min(categoryCount, 4) - : categoryCount, - }).map((_, index) => ( -
- ( +
-
-
- +
+ +
-
- -
- ))} -
- )} + +
+ ))} +
+ )} - {/* Menu Items Skeleton */} - {(variant === "default" || - variant === "minimal" || - variant === "detailed" || - variant === "menu-only") && ( -
- {Array.from({ length: variant === "minimal" ? 1 : 3 }).map( - (_, sectionIndex) => ( -
- {/* Section Header Skeleton */} - {/*
+ {Array.from({ length: variant === "minimal" ? 1 : 3 }).map( + (_, sectionIndex) => ( +
+ {/* Section Header Skeleton */} + {/*
*/} -
- {Array.from({ - length: - variant === "minimal" - ? Math.min(itemCount, 4) - : itemCount, - }).map((_, itemIndex) => ( - -
+ {Array.from({ + length: + variant === "minimal" + ? Math.min(itemCount, 4) + : itemCount, + }).map((_, itemIndex) => ( +
- {/* Item Description Skeleton */} - - {/* Action Icons Skeleton */} -
+ > + {/* Item Description Skeleton */} + + {/* Action Icons Skeleton */} +
-
- {/* Item Image Skeleton */} - {" "} +
+ {/* Item Image Skeleton */} + {" "} +
-
- - ))} + + ))} +
-
- ) - )} -
- )} -
+ ), + )} +
+ )} + + ); };