u
This commit is contained in:
@@ -10,7 +10,7 @@ import ListItemText from '@mui/material/ListItemText';
|
||||
import GetAppIcon from '@mui/icons-material/GetApp';
|
||||
import SettingsIcon from '@mui/icons-material/Settings';
|
||||
import PageLayout from './PageLayout';
|
||||
import { NAV_ITEMS, SUB_NAV } from '../nav';
|
||||
import { NAV_ITEMS, SUB_NAV, resolveActiveSub } from '../nav';
|
||||
import { isKategorienPath } from '../pages/artikel/categoryRoute';
|
||||
import { selectRenameMode, setRenameMode } from '../store/categorySlice';
|
||||
import { ActionElevatedPill, ToggleElevatedPill } from './ElevatedPill';
|
||||
@@ -34,13 +34,8 @@ export default function SectionLayout({ sectionPath }) {
|
||||
const [extrasAnchor, setExtrasAnchor] = useState(null);
|
||||
const title = NAV_ITEMS.find((item) => item.path === sectionPath)?.label ?? '';
|
||||
const subNav = SUB_NAV[sectionPath];
|
||||
const activeSub = subNav?.find((item) => {
|
||||
if (item.segment === 'kategorien') {
|
||||
return isKategorienPath(pathname);
|
||||
}
|
||||
const subPath = item.segment ? `${sectionPath}/${item.segment}` : sectionPath;
|
||||
return pathname === subPath || pathname === `${subPath}/`;
|
||||
});
|
||||
const subSegment = resolveActiveSub(pathname, sectionPath);
|
||||
const activeSub = subNav?.find((item) => item.segment === subSegment);
|
||||
|
||||
const knownSegments = new Set((subNav ?? []).map((item) => item.segment).filter(Boolean));
|
||||
const rest = pathname.slice(sectionPath.length).replace(/^\//, '').split('/')[0];
|
||||
@@ -107,8 +102,6 @@ export default function SectionLayout({ sectionPath }) {
|
||||
<PageLayout
|
||||
title={pageTitle}
|
||||
showTitle={!isArticleDetail}
|
||||
subNav={subNav}
|
||||
basePath={sectionPath}
|
||||
titleAction={titleAction}
|
||||
>
|
||||
<Outlet />
|
||||
|
||||
Reference in New Issue
Block a user