[WIP] Improvement

This commit is contained in:
2022-08-29 12:00:49 +07:00
parent 10f99bfb9a
commit b942a7e468
30 changed files with 1395 additions and 328 deletions

View File

@@ -18,7 +18,7 @@ type NavListRootProps = {
export function NavListRoot({ list, isCollapse }: NavListRootProps) {
const { pathname } = useLocation();
const active = getActive(list.path, pathname);
const active = getActive(list.path, pathname, list.openWhen);
const [open, setOpen] = useState(active);

View File

@@ -30,9 +30,10 @@ export default function NavSectionVertical({
}: NavSectionProps) {
return (
<Box {...other}>
{navConfig.map((group) => (
<List key={group.subheader} disablePadding sx={{ px: 2 }}>
{navConfig.map((group, index) => (
<List key={index} disablePadding sx={{ px: 2 }}>
<ListSubheaderStyle
key={index}
sx={{
...(isCollapse && {
opacity: 0,