From 61703fcc665c1d79b59cee72273ed913f138bc0b Mon Sep 17 00:00:00 2001 From: PJColombo Date: Sun, 11 Aug 2024 19:28:29 +0200 Subject: [PATCH] refactor(web): replace conventional links with nextjs `Link` components in `SidebarNavigationMenu` --- .../src/components/SidebarNavigationMenu.tsx | 54 +++++++++++++------ 1 file changed, 39 insertions(+), 15 deletions(-) diff --git a/apps/web/src/components/SidebarNavigationMenu.tsx b/apps/web/src/components/SidebarNavigationMenu.tsx index 26bda496f..d2cfd260e 100644 --- a/apps/web/src/components/SidebarNavigationMenu.tsx +++ b/apps/web/src/components/SidebarNavigationMenu.tsx @@ -1,4 +1,5 @@ -import { useEffect, useState } from "react"; +import { useCallback, useEffect, useState } from "react"; +import Link from "next/link"; import { usePathname } from "next/navigation"; import { ChevronDownIcon } from "@heroicons/react/24/outline"; import { Bars3Icon } from "@heroicons/react/24/solid"; @@ -16,14 +17,14 @@ import { isExpandibleNavigationItem, NAVIGATION_ITEMS } from "./content"; export function SidebarNavigationMenu({ className }: { className?: string }) { const [open, setOpen] = useState(false); + const openSidebar = useCallback(() => setOpen(true), []); + + const closeSidebar = useCallback(() => setOpen(false), []); + return (
-