From 50b734cf241cb4fcaed2113a3f8c15ef27f6ef89 Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Mon, 8 Dec 2025 21:58:35 +0000 Subject: [PATCH] sidebar --- client/src/components/layouts/RootLayout.tsx | 22 +++++++++++++------ .../src/components/layouts/sidebar/index.tsx | 9 ++++---- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/client/src/components/layouts/RootLayout.tsx b/client/src/components/layouts/RootLayout.tsx index ceaf7a126..4792ac4ec 100644 --- a/client/src/components/layouts/RootLayout.tsx +++ b/client/src/components/layouts/RootLayout.tsx @@ -1,22 +1,30 @@ import { Outlet } from "react-router"; import Stack from "@mui/material/Stack"; -import { SideBar } from "@/components/layouts/sidebar"; +import { + SideBar, + COLLAPSED_WIDTH, + EXPANDED_WIDTH, +} from "@/components/layouts/sidebar"; import { useTheme } from "@mui/material/styles"; +import useMediaQuery from "@mui/material/useMediaQuery"; const RootLayout = () => { const theme = useTheme(); + const isSmall = useMediaQuery(theme.breakpoints.down("md")); return ( diff --git a/client/src/components/layouts/sidebar/index.tsx b/client/src/components/layouts/sidebar/index.tsx index fa0179a43..5c09e3b44 100644 --- a/client/src/components/layouts/sidebar/index.tsx +++ b/client/src/components/layouts/sidebar/index.tsx @@ -38,8 +38,9 @@ export const SideBar = () => { return ( { width={sideBarOpen ? EXPANDED_WIDTH : COLLAPSED_WIDTH} sx={{ transition: "width 650ms cubic-bezier(0.36, -0.01, 0, 0.77)", + zIndex: isSmall ? (t) => t.zIndex.drawer : "auto", + backgroundColor: theme.palette.background.paper, }} > @@ -102,9 +105,7 @@ export const SideBar = () => { ); })} - + );