diff --git a/lazy-timer-fe/src/components/Sidebar.jsx b/lazy-timer-fe/src/components/Sidebar.jsx new file mode 100644 index 0000000..6817233 --- /dev/null +++ b/lazy-timer-fe/src/components/Sidebar.jsx @@ -0,0 +1,70 @@ +import React from 'react'; +import { Link, NavLink } from 'react-router-dom'; +import { SiShopware } from 'react-icons/si'; +import { MdOutlineCancel } from 'react-icons/md'; +import { TooltipComponent } from '@syncfusion/ej2-react-popups'; + +import { links } from '../data/dummy'; +import { useStateContext } from '../contexts/ContextProvider'; + +const Sidebar = () => { + const { currentColor, activeMenu, setActiveMenu, screenSize } = useStateContext(); + + const handleCloseSideBar = () => { + if (activeMenu !== undefined && screenSize <= 900) { + setActiveMenu(false); + } + }; + + const activeLink = 'flex items-center gap-5 pl-4 pt-3 pb-2.5 rounded-lg text-white text-md m-2'; + const normalLink = 'flex items-center gap-5 pl-4 pt-3 pb-2.5 rounded-lg text-md text-gray-700 dark:text-gray-200 dark:hover:text-black hover:bg-light-gray m-2'; + + return ( +
+ {activeMenu && ( + <> +
+ + Shoppy + + + + +
+
+ {links.map((item) => ( +
+

+ {item.title} +

+ {item.links.map((link) => ( + ({ + backgroundColor: isActive ? currentColor : '', + })} + className={({ isActive }) => (isActive ? activeLink : normalLink)} + > + {link.icon} + {link.name} + + ))} +
+ ))} +
+ + )} +
+ ); +}; + +export default Sidebar;