diff --git a/base/ts/mui/Drawer.tsx b/base/ts/mui/Drawer.tsx index ae594874..e72fa3e8 100644 --- a/base/ts/mui/Drawer.tsx +++ b/base/ts/mui/Drawer.tsx @@ -15,6 +15,7 @@ */ import React from 'react'; +import { matchPath, useLocation } from 'react-router-dom'; import Box from '@mui/material/Box'; import Toolbar from '@mui/material/Toolbar'; @@ -45,40 +46,48 @@ export interface DrawerProps { const drawerWidth = 240; export const Drawer = (props: DrawerProps) => { + const location = useLocation(); + return ( - + - + {props.sections.map((section: DrawerSection) => ( - <> + {section.title && {section.title}} {section.links.map((link: DrawerLink) => ( - + - {link.icon && ( - - {link.icon} - - )} + {link.icon && {link.icon}} ))} - + ))}