@ -1,4 +1,4 @@
|
|||||||
import { useNavigate } from 'react-router-dom';
|
import { useLocation, useNavigate } from 'react-router-dom';
|
||||||
|
|
||||||
import { useObjectMetadataItemForSettings } from '@/object-metadata/hooks/useObjectMetadataItemForSettings';
|
import { useObjectMetadataItemForSettings } from '@/object-metadata/hooks/useObjectMetadataItemForSettings';
|
||||||
import { Icon123 } from '@/ui/input/constants/icons';
|
import { Icon123 } from '@/ui/input/constants/icons';
|
||||||
@ -9,6 +9,7 @@ export const ObjectMetadataNavItems = () => {
|
|||||||
const { activeObjectMetadataItems } = useObjectMetadataItemForSettings();
|
const { activeObjectMetadataItems } = useObjectMetadataItemForSettings();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const { icons } = useLazyLoadIcons();
|
const { icons } = useLazyLoadIcons();
|
||||||
|
const currentPath = useLocation().pathname;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@ -19,6 +20,7 @@ export const ObjectMetadataNavItems = () => {
|
|||||||
key={objectMetadataItem.id}
|
key={objectMetadataItem.id}
|
||||||
label={objectMetadataItem.labelPlural}
|
label={objectMetadataItem.labelPlural}
|
||||||
to={`/objects/${objectMetadataItem.namePlural}`}
|
to={`/objects/${objectMetadataItem.namePlural}`}
|
||||||
|
active={currentPath == `/objects/${objectMetadataItem.namePlural}`}
|
||||||
Icon={
|
Icon={
|
||||||
objectMetadataItem.icon ? icons[objectMetadataItem.icon] : Icon123
|
objectMetadataItem.icon ? icons[objectMetadataItem.icon] : Icon123
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user