MenuSkeleton: fix desktop size

This commit is contained in:
2025-10-06 01:44:09 +03:00
parent 8df4477ac5
commit b385d40913
2 changed files with 267 additions and 236 deletions

View File

@@ -18,6 +18,24 @@
gap: 16px; 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 { .leftShape {
position: absolute; position: absolute;
top: 133px; top: 133px;
@@ -49,6 +67,12 @@
/* Enhanced responsive categories container */ /* Enhanced responsive categories container */
@media (min-width: 769px) and (max-width: 1024px) { @media (min-width: 769px) and (max-width: 1024px) {
.logo {
left: 40px;
width: 80px;
height: 80px;
}
.categoriesContainer { .categoriesContainer {
height: 160px; height: 160px;
padding: 0 24px; padding: 0 24px;
@@ -65,17 +89,23 @@
} }
.leftShape { .leftShape {
top: 170px; top: 150px;
left: -3px; left: -3px;
} }
.rightShape { .rightShape {
top: 170px; top: 150px;
left: 116px; left: 116px;
} }
} }
@media (min-width: 1025px) { @media (min-width: 1025px) {
.logo {
left: 33px;
top: 141px;
width: 150px !important;
height: 150px !important;
}
.categoriesContainer { .categoriesContainer {
height: 180px; height: 180px;
padding: 0 24px; padding: 0 24px;
@@ -94,6 +124,16 @@
max-width: 100vw !important; max-width: 100vw !important;
margin: 0 !important; margin: 0 !important;
} }
.leftShape {
top: 170px;
left: -10px;
}
.rightShape {
top: 170px;
left: 185px;
}
} }
.menuSection:first-child h3 { .menuSection:first-child h3 {

View File

@@ -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"; import styles from "./MenuSkeleton.module.css";
interface MenuSkeletonProps { interface MenuSkeletonProps {
@@ -12,17 +13,12 @@ interface MenuSkeletonProps {
| "menu-only"; | "menu-only";
} }
const { useBreakpoint } = Grid;
const MenuSkeleton = ({ const MenuSkeleton = ({
categoryCount = 6, categoryCount = 8,
itemCount = 8, itemCount = 8,
variant = "default", variant = "default",
}: MenuSkeletonProps) => { }: MenuSkeletonProps) => {
const { xs, md } = useBreakpoint(); const { isMobile, isTablet } = useBreakPoint();
const isMobile = xs;
const isTablet = !xs && !md;
// const isDesktop = md;
const getCategoryCardStyle = () => { const getCategoryCardStyle = () => {
if (isMobile) { if (isMobile) {
@@ -106,40 +102,30 @@ const MenuSkeleton = ({
} }
}; };
const getGridClass = () => {
if (isMobile) {
return styles.menuItemsGridMobile;
} else if (isTablet) {
return styles.menuItemsGridTablet;
} else {
return styles.menuItemsGridDesktop;
}
};
return ( return (
<div className={`${styles.pageContainer} ${styles.skeletonContainer}`}> <>
{/* Restaurant Header Skeleton */} {/* Restaurant Header Skeleton */}
<div className={styles.restaurantHeader}> <div className={styles.restaurantHeader}>
{/* Cover Image Skeleton */} {/* Cover Image Skeleton */}
<Skeleton.Image <Skeleton.Image
active active
className={styles.cover}
style={{ style={{
width: "100vw", width: "100vw",
height: isMobile ? 182 : isTablet ? 200 : 220, height: isMobile ? 182 : isTablet ? 200 : 220,
borderRadius: 0, borderRadius: 0,
}} }}
/> />
{/* Logo Skeleton */} {/* Logo Skeleton */}
<Skeleton.Image <Skeleton.Image
active active
style={{ style={{
position: "absolute", position: "absolute",
left: isMobile ? "33px" : "40px", left: isMobile ? "33px" : isTablet ? "40px" : "36px",
top: isMobile ? "133px" : isTablet ? "170px" : "170px", top: isMobile ? "133px" : isTablet ? "150px" : "130px",
borderRadius: "50%", borderRadius: "50%",
width: isMobile ? "72px" : isTablet ? "80px" : "80px", width: isMobile ? "72px" : isTablet ? "80px" : "150px",
height: isMobile ? "72px" : isTablet ? "80px" : "80px", height: isMobile ? "72px" : isTablet ? "80px" : "150px",
border: "3px solid var(--background)", border: "3px solid var(--background)",
zIndex: 10, zIndex: 10,
overflow: "hidden", overflow: "hidden",
@@ -150,7 +136,7 @@ const MenuSkeleton = ({
<div className={styles.leftShape}></div> <div className={styles.leftShape}></div>
<div className={styles.rightShape}></div> <div className={styles.rightShape}></div>
</div> </div>
<div className={`${styles.pageContainer} ${styles.skeletonContainer}`}>
{/* Restaurant Info Skeleton */} {/* Restaurant Info Skeleton */}
<div className={styles.restaurantInfoSkeleton}> <div className={styles.restaurantInfoSkeleton}>
<div <div
@@ -181,7 +167,9 @@ const MenuSkeleton = ({
marginBottom: "0.5rem", marginBottom: "0.5rem",
}} }}
> >
<div style={{ display: "flex", alignItems: "center", gap: "8px" }}> <div
style={{ display: "flex", alignItems: "center", gap: "8px" }}
>
<Skeleton.Image <Skeleton.Image
active active
style={{ style={{
@@ -349,7 +337,9 @@ const MenuSkeleton = ({
/> />
</div> */} </div> */}
<div className={`${styles.menuItemsGrid} ${getGridClass()}`}> <div
className={`${styles.menuItemsGrid} ${styles.menuItemsGrid}`}
>
{Array.from({ {Array.from({
length: length:
variant === "minimal" variant === "minimal"
@@ -416,11 +406,12 @@ const MenuSkeleton = ({
))} ))}
</div> </div>
</div> </div>
) ),
)} )}
</div> </div>
)} )}
</div> </div>
</>
); );
}; };