Created a breadcrumb for left nav menu sub items (#6762)
Closes https://github.com/twentyhq/twenty/issues/6484 <img width="270" alt="image" src="https://github.com/user-attachments/assets/3cfd7a5a-5239-4998-87f7-a9b45e3b5229">
This commit is contained in:
@ -6,32 +6,38 @@ import {
|
||||
NavigationDrawerItem,
|
||||
NavigationDrawerItemProps,
|
||||
} from '@/ui/navigation/navigation-drawer/components/NavigationDrawerItem';
|
||||
import { NavigationDrawerSubItemState } from '@/ui/navigation/navigation-drawer/types/NavigationDrawerSubItemState';
|
||||
|
||||
type SettingsNavigationDrawerItemProps = Pick<
|
||||
NavigationDrawerItemProps,
|
||||
'Icon' | 'label' | 'level' | 'soon'
|
||||
'Icon' | 'label' | 'indentationLevel' | 'soon'
|
||||
> & {
|
||||
matchSubPages?: boolean;
|
||||
path: SettingsPath;
|
||||
subItemState?: NavigationDrawerSubItemState;
|
||||
};
|
||||
|
||||
export const SettingsNavigationDrawerItem = ({
|
||||
Icon,
|
||||
label,
|
||||
level,
|
||||
indentationLevel,
|
||||
matchSubPages = false,
|
||||
path,
|
||||
soon,
|
||||
subItemState,
|
||||
}: SettingsNavigationDrawerItemProps) => {
|
||||
const href = getSettingsPagePath(path);
|
||||
const pathName = useResolvedPath(href).pathname;
|
||||
|
||||
const isActive = !!useMatch({
|
||||
path: useResolvedPath(href).pathname,
|
||||
path: pathName,
|
||||
end: !matchSubPages,
|
||||
});
|
||||
|
||||
return (
|
||||
<NavigationDrawerItem
|
||||
level={level}
|
||||
indentationLevel={indentationLevel}
|
||||
subItemState={subItemState}
|
||||
label={label}
|
||||
to={href}
|
||||
Icon={Icon}
|
||||
|
||||
Reference in New Issue
Block a user