[WIP] Improvement
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user