@@ -17,9 +15,9 @@ export const SidebarHeader = ({ setOpen }: SidebarProps): JSX.Element => {
className="p-3 text-2xl bg:white dark:bg-black text-black dark:text-white hover:text-primary dark:hover:text-gray-200 transition-colors"
type="button"
data-testid="close-sidebar-button"
- onClick={() => setOpen(false)}
+ onClick={() => setIsOpened(false)}
>
-
+
diff --git a/frontend/lib/context/SidebarProvider/hooks/useSideBarContext.ts b/frontend/lib/context/SidebarProvider/hooks/useSideBarContext.ts
new file mode 100644
index 000000000000..912b31f56b48
--- /dev/null
+++ b/frontend/lib/context/SidebarProvider/hooks/useSideBarContext.ts
@@ -0,0 +1,13 @@
+import { useContext } from "react";
+
+import { SideBarContext } from "../sidebar-provider";
+
+// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
+export const useSideBarContext = () => {
+ const context = useContext(SideBarContext);
+ if (context === undefined) {
+ throw new Error("useSideBarContext must be used within a SideBarProvider");
+ }
+
+ return context;
+};
diff --git a/frontend/lib/context/SidebarProvider/sidebar-provider.tsx b/frontend/lib/context/SidebarProvider/sidebar-provider.tsx
new file mode 100644
index 000000000000..503a32f6dd4d
--- /dev/null
+++ b/frontend/lib/context/SidebarProvider/sidebar-provider.tsx
@@ -0,0 +1,36 @@
+import { createContext, useEffect, useState } from "react";
+
+import { useDevice } from "@/lib/hooks/useDevice";
+
+type SideBarContextType = {
+ isOpened: boolean;
+ setIsOpened: React.Dispatch