Skip to content

Commit

Permalink
fix: add toggleSidebar onClick menu
Browse files Browse the repository at this point in the history
  • Loading branch information
eliasrosa committed Nov 25, 2023
1 parent a0ba2e8 commit 95494ed
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/components/layout/SidebarMenuItem.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { useSidebar } from '@/hooks/useSidebar'
import { Icon } from '@phosphor-icons/react'
import Link from 'next/link'

Expand All @@ -8,10 +9,13 @@ interface MenuItemProps {
}

export function SidebarMenuItem({ label, icon: Icon, href }: MenuItemProps) {
const { toggleSidebar } = useSidebar()

return (
<li className="my-px">
<Link
href={href}
onClick={toggleSidebar}
data-testid="sidebar-menu-item"
className="group flex flex-row items-center h-10 px-3 rounded-lg text-gray-300 hover:bg-blue-600"
>
Expand Down

0 comments on commit 95494ed

Please sign in to comment.