From 6fae24eebca17c49f7409ef60df49f14e68c8eeb Mon Sep 17 00:00:00 2001 From: mamadoudicko Date: Wed, 13 Dec 2023 15:11:36 +0100 Subject: [PATCH] feat: keep sidebar closed after page change --- frontend/lib/context/SidebarProvider/sidebar-provider.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/frontend/lib/context/SidebarProvider/sidebar-provider.tsx b/frontend/lib/context/SidebarProvider/sidebar-provider.tsx index a3eb7320cce4..503a32f6dd4d 100644 --- a/frontend/lib/context/SidebarProvider/sidebar-provider.tsx +++ b/frontend/lib/context/SidebarProvider/sidebar-provider.tsx @@ -1,4 +1,3 @@ -import { usePathname } from "next/navigation"; import { createContext, useEffect, useState } from "react"; import { useDevice } from "@/lib/hooks/useDevice"; @@ -19,11 +18,10 @@ export const SideBarProvider = ({ }): JSX.Element => { const { isMobile } = useDevice(); const [isOpened, setIsOpened] = useState(!isMobile); - const pathname = usePathname(); useEffect(() => { setIsOpened(!isMobile); - }, [isMobile, pathname]); + }, [isMobile]); return (