diff --git a/src/components/MenuBar.jsx b/src/components/MenuBar.jsx index 06b385b..f2959d3 100644 --- a/src/components/MenuBar.jsx +++ b/src/components/MenuBar.jsx @@ -3,35 +3,49 @@ import PropTypes from "prop-types"; import { useTranslation } from "react-i18next"; import clsx from "clsx"; import { useState } from "react"; +import { AnimatePresence, motion } from "motion/react"; function SubMenu({ items, isVisible, onLinkClick }) { const { t } = useTranslation(); return ( -
- {items.map((subItem, index) => ( -
- {t(subItem.name)} + + {isVisible && ( +
+ + {items.map((subItem, index) => ( +
+ {t(subItem.name)} +
+ ))} +
+ + +
- ))} - - - -
+ )} + ); } @@ -41,14 +55,20 @@ function MenuBar({ menuItems }) { return (
{menuItems.map((item, index) => ( -
setActiveMenu(index)} onMouseLeave={() => setActiveMenu(null)} > {t(item.name)} - {item.submenu.length > 0 && setActiveMenu(null)}/>} + {item.submenu.length > 0 && ( + setActiveMenu(null)} + /> + )}
))}