u
This commit is contained in:
10
src/nav.js
10
src/nav.js
@@ -10,6 +10,7 @@ import ListAltIcon from '@mui/icons-material/ListAlt';
|
||||
import ArchiveIcon from '@mui/icons-material/Archive';
|
||||
import GroupsIcon from '@mui/icons-material/Groups';
|
||||
import ContactPageIcon from '@mui/icons-material/ContactPage';
|
||||
import { isKategorienPath } from './pages/artikel/categoryRoute';
|
||||
|
||||
export const NAV_ITEMS = [
|
||||
{ path: '/artikel', label: 'Artikel', icon: Inventory2Icon },
|
||||
@@ -19,6 +20,15 @@ export const NAV_ITEMS = [
|
||||
{ path: '/infos', label: 'Infos', icon: InfoIcon },
|
||||
];
|
||||
|
||||
export function isNavItemActive(pathname, navPath) {
|
||||
if (navPath === '/artikel') {
|
||||
return pathname === navPath
|
||||
|| pathname.startsWith(`${navPath}/`)
|
||||
|| isKategorienPath(pathname);
|
||||
}
|
||||
return pathname === navPath || pathname.startsWith(`${navPath}/`);
|
||||
}
|
||||
|
||||
export const SUB_NAV = {
|
||||
'/artikel': [
|
||||
{ segment: '', icon: ViewListIcon },
|
||||
|
||||
Reference in New Issue
Block a user