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:
Lucas Bordeau
2024-08-30 15:10:18 +02:00
committed by GitHub
parent 09ac8e3274
commit 26eba76fb5
16 changed files with 450 additions and 165 deletions

View File

@ -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}