diff --git a/client/src/Components/sidebar/index.tsx b/client/src/Components/sidebar/index.tsx index 1821f5a79..01c89737d 100644 --- a/client/src/Components/sidebar/index.tsx +++ b/client/src/Components/sidebar/index.tsx @@ -32,7 +32,7 @@ export const Sidebar = () => { const navigate = useNavigate(); const location = useLocation(); const { t } = useTranslation(); - const { width, transition, collapsed } = useSidebar(); + const { width, transition, transitionTiming, collapsed } = useSidebar(); const theme = useTheme(); const isSmall = useMediaQuery(theme.breakpoints.down("md")); const menu = getMenu(t); @@ -94,16 +94,10 @@ export const Sidebar = () => { /> {menu.map((group, groupIndex) => ( - {collapsed ? ( - groupIndex > 0 && ( - - ) - ) : ( + { paddingLeft={theme.spacing(5)} paddingTop={theme.spacing(LAYOUT.SM)} paddingBottom={theme.spacing(LAYOUT.XXS)} + whiteSpace="nowrap" + sx={{ + opacity: collapsed ? 0 : 1, + transition: `opacity ${transitionTiming}`, + }} > {group.group} - )} + {groupIndex > 0 && ( + + )} + {group.items.map((item) => { const selected = location.pathname.startsWith(`/${item.path}`); return ( diff --git a/client/src/Hooks/useSidebar.ts b/client/src/Hooks/useSidebar.ts index 1cf705dd1..0229d8640 100644 --- a/client/src/Hooks/useSidebar.ts +++ b/client/src/Hooks/useSidebar.ts @@ -6,7 +6,8 @@ const SIDEBAR_WIDTH_VAR = 250; const SIDEBAR_COLLAPSED_WIDTH_VAR = 64; // Transition timing for sidebar width changes -const SIDEBAR_TRANSITION = "width 650ms cubic-bezier(0.36, -0.01, 0, 0.77)"; +const SIDEBAR_TRANSITION_TIMING = "650ms cubic-bezier(0.36, -0.01, 0, 0.77)"; +const SIDEBAR_TRANSITION = `width ${SIDEBAR_TRANSITION_TIMING}`; export const useSidebar = () => { const collapsed = useSelector( @@ -19,6 +20,7 @@ export const useSidebar = () => { expandedWidth: SIDEBAR_WIDTH_VAR, width: collapsed ? SIDEBAR_COLLAPSED_WIDTH_VAR : SIDEBAR_WIDTH_VAR, transition: SIDEBAR_TRANSITION, + transitionTiming: SIDEBAR_TRANSITION_TIMING, }; };