From b385d409134eff12585548832e9385fd20f689ff Mon Sep 17 00:00:00 2001 From: Mohammed Al-yaseen Date: Mon, 6 Oct 2025 01:44:09 +0300 Subject: [PATCH 1/3] 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 */} + {" "} +
-
- - ))} + + ))} +
-
- ) - )} -
- )} -
+ ), + )} +
+ )} + + ); }; From 7dd0857ea32576182b5a066139068f09f37bccd4 Mon Sep 17 00:00:00 2001 From: Mohammed Al-yaseen Date: Mon, 6 Oct 2025 01:45:23 +0300 Subject: [PATCH 2/3] add Header for cart page --- src/index.css | 4 +- src/layouts/app/App.tsx | 231 ------------------ src/layouts/app/AppLayout.tsx | 80 ++++++ src/layouts/app/index.ts | 3 +- src/layouts/app/styles.css | 49 ++++ .../components/MenuList/MenuList.module.css | 90 +------ .../menu/components/MenuList/MenuList.tsx | 27 +- src/pages/menu/page.tsx | 4 +- src/routes/routes.tsx | 11 +- 9 files changed, 162 insertions(+), 337 deletions(-) delete mode 100644 src/layouts/app/App.tsx create mode 100644 src/layouts/app/AppLayout.tsx diff --git a/src/index.css b/src/index.css index 2df06d0..c1f5198 100644 --- a/src/index.css +++ b/src/index.css @@ -4,6 +4,8 @@ :root { --background: #f7f7f7; --foreground: #181818; + --primary-light: #fff; + --primary-dark: #0a0a0a; --primary: #ffb700; --primary2: #ffc600; --secondary: #09237d; @@ -304,4 +306,4 @@ label { > label.ant-form-item-required::before { position: relative !important; top: 3px !important; -} +} \ No newline at end of file diff --git a/src/layouts/app/App.tsx b/src/layouts/app/App.tsx deleted file mode 100644 index 532f481..0000000 --- a/src/layouts/app/App.tsx +++ /dev/null @@ -1,231 +0,0 @@ -import { - LogoutOutlined, - QuestionOutlined, - SettingOutlined, - UserOutlined, -} from "@ant-design/icons"; -import { - Dropdown, - Flex, - FloatButton, - Layout, - MenuProps, - message, - theme, - Tooltip, - Typography, -} from "antd"; -import { ReactNode, useEffect, useRef, useState } from "react"; -import { useLocation, useNavigate } from "react-router-dom"; - -import dayjs from "dayjs"; -import { logout } from "features/auth/authSlice.ts"; -import { useTranslation } from "react-i18next"; -import { useAppDispatch } from "redux/hooks.ts"; -import { PATH_AUTH } from "utils/constants.ts"; -import LangSelect from "./components/langSelect/LangSelect.tsx"; -import HeaderNav from "./HeaderNav.tsx"; -import SideNav from "./SideNav.tsx"; -import "./styles.css"; - -const { Content } = Layout; -const { Title } = Typography; -type AppLayoutProps = { - withSidebar?: boolean; - children: ReactNode; -}; - -export const AppLayout = ({ children, withSidebar = true }: AppLayoutProps) => { - const dispatch = useAppDispatch(); - const { t } = useTranslation(); - const { - token: { borderRadius }, - } = theme.useToken(); - const [navFill, setNavFill] = useState(false); - const navigate = useNavigate(); - const nodeRef = useRef(null); - const floatBtnRef = useRef(null); - const location = useLocation(); - const isMenu = location.pathname === "/menu"; - - const items: MenuProps["items"] = [ - { - key: "user-profile-link", - label: t("profile"), - icon: , - }, - { - key: "user-settings-link", - label: t("settings"), - icon: , - }, - { - key: "user-help-link", - label: t("help center"), - icon: , - }, - { - type: "divider", - }, - { - key: "user-logout-link", - label: t("logout"), - icon: , - danger: true, - onClick: () => { - message.open({ - type: "loading", - content: t("msg-success-logout"), - }); - - dispatch(logout()); - - setTimeout(() => { - navigate(PATH_AUTH.signin); - }, 1000); - }, - }, - ]; - - useEffect(() => { - window.addEventListener("scroll", () => { - if (window.scrollY > 5) { - setNavFill(true); - } else { - setNavFill(false); - } - }); - }, []); - - return ( - <> - - {withSidebar && ( - - )} - - - - - - {dayjs().format("DD/MM/YYYY")}{" "} - - - - - - - - {/* - - */} - - - {/* -