Files
Checkmate/client/src/Components/v1/Layouts/HomeLayout/index.jsx
T
gorkem-bwl 3a77c6d7fa Fix sidebar gap when scrolling on pages with tall content
The sidebar was showing a visible gap at the bottom when scrolling on
pages with tall tables (e.g., /checks). This occurred because the
parent container's overflow-x: hidden was breaking sticky positioning.

Changes:
- Changed sidebar from position: sticky to position: fixed
- Added a spacer Box element to maintain layout spacing
- Moved border and background styles to the sidebar component
- Cleaned up unused CSS selectors
2026-01-16 22:26:43 -05:00

35 lines
778 B
React

import Sidebar from "../../Sidebar/index.jsx";
import { Outlet } from "react-router";
import { Box, Stack } from "@mui/material";
import { useSelector } from "react-redux";
import "./index.css";
const HomeLayout = () => {
const collapsed = useSelector((state) => state.ui.sidebar?.collapsed ?? false);
return (
<Stack
className="home-layout"
flexDirection="row"
>
<Sidebar />
{/* Spacer for fixed sidebar */}
<Box
sx={{
width: collapsed
? "var(--env-var-side-bar-collapsed-width)"
: "var(--env-var-side-bar-width)",
flexShrink: 0,
transition: "width 650ms cubic-bezier(0.36, -0.01, 0, 0.77)",
}}
/>
<Stack className="home-content-wrapper">
<Outlet />
</Stack>
</Stack>
);
};
export default HomeLayout;