Skip to content

Commit

Permalink
fix: dropdown autoclose
Browse files Browse the repository at this point in the history
  • Loading branch information
AE-Hertz committed Oct 29, 2024
1 parent 19f0a2b commit 7107575
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/components/Global/Navbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ const Navbar = () => {
{ href: '/Hackathon', label: 'Hackathons' },
{ href: '/Events', label: 'Events' }
]}
closeDropdown={closeAll}
/>

<Link href="/About" className="nav-link">
Expand All @@ -100,6 +101,7 @@ const Navbar = () => {
{ href: '/Resources', label: 'Resources' },
{ href: '/localdev', label: 'Connect To Local Dev' }
]}
closeDropdown={closeAll}
/>

<Link href="/GeminiAI" className="nav-link">
Expand All @@ -115,6 +117,7 @@ const Navbar = () => {
{ href: '/careers', label: 'Careers' },
{ href: '/Stories-Achievements', label: 'Stories & Achievements' }
]}
closeDropdown={closeAll}
/>
</div>

Expand Down Expand Up @@ -240,7 +243,7 @@ const Navbar = () => {
};

// Desktop Navigation Item Component
const NavItem = ({ type, label, isOpen, onToggle, items }) => {
const NavItem = ({ type, label, isOpen, onToggle, items, closeDropdown}) => {
if (type === 'dropdown') {
return (
<div className="relative">
Expand All @@ -258,6 +261,7 @@ const NavItem = ({ type, label, isOpen, onToggle, items }) => {
key={item.href}
href={item.href}
className="block px-4 py-2 text-sm text-gray-700 hover:bg-gray-50 hover:text-blue-600"
onClick={closeDropdown}
>
{item.label}
</Link>
Expand Down

0 comments on commit 7107575

Please sign in to comment.