From a63a45e3b735b21d904cf403a26d8d251ee83d9d Mon Sep 17 00:00:00 2001 From: Aman Singh <151001715+Amansingh0807@users.noreply.github.com> Date: Fri, 3 Jan 2025 14:05:13 +0530 Subject: [PATCH] Update Navbar.jsx Created a reusable NavLink component for mobile menu items to reduce redundancy. Removed unnecessary md:border class in the mobile menu. Simplified the logic for toggling the mobile menu, reducing repetitive code. I did all the changes that were mentioned in the issue number #21. Have a look at the changes if anything is require to be changed, please let me know for the same. --- StoreHUB-fronted/src/components/Navbar.jsx | 65 +++++++--------------- 1 file changed, 20 insertions(+), 45 deletions(-) diff --git a/StoreHUB-fronted/src/components/Navbar.jsx b/StoreHUB-fronted/src/components/Navbar.jsx index 925a739..b4c3edf 100644 --- a/StoreHUB-fronted/src/components/Navbar.jsx +++ b/StoreHUB-fronted/src/components/Navbar.jsx @@ -19,7 +19,7 @@ const Navbar = () => { user && ( @@ -126,4 +89,16 @@ const NavItem = ({ icon, label }) => ( ); +// New reusable component for mobile links +const NavLink = ({ to, label, icon, onClose }) => ( + onClose(false)} + > + {icon} + {label} + +); + export default Navbar;