From 8bc2d25b4f9160680be3194af38c3ce610ce9928 Mon Sep 17 00:00:00 2001 From: Sumit Akhuli Date: Mon, 16 Feb 2026 03:19:59 +0530 Subject: [PATCH] feat(menu): improve visual structure with cards, icons and timeline --- src/components/restaurant/MenuTable.jsx | 148 ++++++---- src/components/restaurant/RestaurantMenu.jsx | 280 ++++++++----------- 2 files changed, 203 insertions(+), 225 deletions(-) diff --git a/src/components/restaurant/MenuTable.jsx b/src/components/restaurant/MenuTable.jsx index 79068c1..66b6b0d 100644 --- a/src/components/restaurant/MenuTable.jsx +++ b/src/components/restaurant/MenuTable.jsx @@ -5,113 +5,143 @@ import { UnorderedList, useColorModeValue, Button, + Box, + Text, + Icon, + Collapse } from "@chakra-ui/react"; +import { SunIcon, MoonIcon, InfoIcon, CheckCircleIcon } from "@chakra-ui/icons"; import i18n from "../../i18n"; function MenuTable({ title, fullMenu, isActive }) { - const [activeMeal, setActiveMeal] = useState(i18n.t('lunch')); + const [foodMenu, setFoodMenu] = useState(fullMenu.gevma.foodMenu); + + const mealIcons = { + [i18n.t('lunch')]: SunIcon, + [i18n.t('dinner')]: MoonIcon + }; + + const categoryAccents = [ + "orange.400", // Main + "purple.400", // Special + "green.400", // Salad + "pink.400", // Dessert + "cyan.400" // Other + ]; - const[foodMenu,setFoodMenu]=useState(fullMenu.gevma.foodMenu); - return ( - - + + {/* Meal Selection Cards */} + + + {i18n.t('lunch')} + - - + + {i18n.t('dinner')} + + + {/* Menu Content */} {Object.keys(foodMenu).map((key, index) => ( - {i18n.t(key)} + + {i18n.t(key)} + - - - {Object.values(foodMenu[key]).map((dish, index) => ( - {dish} + + + + {Object.values(foodMenu[key]).map((dish, i) => ( + + {dish} + ))} - + ))} - - {i18n.t(activeMeal)} - ); } diff --git a/src/components/restaurant/RestaurantMenu.jsx b/src/components/restaurant/RestaurantMenu.jsx index a2c7ea0..fe7a5a9 100644 --- a/src/components/restaurant/RestaurantMenu.jsx +++ b/src/components/restaurant/RestaurantMenu.jsx @@ -47,191 +47,139 @@ import { ListItem, Text, useColorModeValue, + Flex, + Circle, + VStack } from "@chakra-ui/react"; - +import { ChevronDownIcon } from "@chakra-ui/icons"; import i18n from "../../i18n"; function Menu({ dailyFoodMenu }) { + const lineColor = useColorModeValue("gray.200", "gray.600"); + const dotColor = useColorModeValue("blue.500", "blue.300"); + const cardBg = useColorModeValue("white", "gray.800"); + return ( - - - - - {dailyFoodMenu.day} - - - - - - - {/*Accordion gia geuma*/} - - + + {/* Timeline Line */} + + + + + {({ isExpanded }) => ( + <> +

- - {i18n.t("gevma")} - - + _focus={{ boxShadow: "none" }} + mb={isExpanded ? 4 : 0} + > + + {/* Timeline Dot */} + + {dailyFoodMenu.day.substring(0, 1)} + + + {/* Day Card Header */} + + + + {dailyFoodMenu.day} + + + + + - - - {Object.values([ +

+ + + + {/* Lunch Section */} + - val ? ( - - - {val} - - - ) : null - )} - - -
-
- {/*Accordion gia deipno*/} - - - - - {i18n.t("deipno")} - - - - - - {Object.values([ + ]} + /> + + {/* Dinner Section */} + - val ? ( - - - {val} - - - ) : null - )} - - - - -
-
-
-
+ ]} + /> + + + + )} + + +
); } +const MealSection = ({ title, items }) => ( + + + {title} + + + {items.map((val, index) => + val ? ( + + • {val} + + ) : null + )} + + +); + export default Menu;