fix IMAP breadcrumb (#13847)
closes https://github.com/twentyhq/twenty/issues/13811 figma - https://www.figma.com/design/xt8O9mFeLl46C5InWwoMrN/Twenty?node-id=72629-202079&t=CHbHe7QGamvPTnAi-0
This commit is contained in:
+5
-1
@@ -10,19 +10,23 @@ import { getSettingsPath } from '~/utils/navigation/getSettingsPath';
|
||||
type SettingsNavigationDrawerItemProps = {
|
||||
item: SettingsNavigationItem;
|
||||
subItemState?: NavigationDrawerSubItemState;
|
||||
hasActiveSubItem?: boolean;
|
||||
};
|
||||
|
||||
export const SettingsNavigationDrawerItem = ({
|
||||
item,
|
||||
subItemState,
|
||||
hasActiveSubItem = false,
|
||||
}: SettingsNavigationDrawerItemProps) => {
|
||||
const href = item.path ? getSettingsPath(item.path) : '';
|
||||
const pathName = useResolvedPath(href).pathname;
|
||||
const isActive = !!useMatch({
|
||||
const matchResult = useMatch({
|
||||
path: pathName,
|
||||
end: item.matchSubPages === false,
|
||||
});
|
||||
|
||||
const isActive = !!matchResult && !hasActiveSubItem;
|
||||
|
||||
if (isDefined(item.isHidden) && item.isHidden) {
|
||||
return null;
|
||||
}
|
||||
|
||||
+2
@@ -55,6 +55,7 @@ export const SettingsNavigationDrawerItems = () => {
|
||||
if (Array.isArray(subItems) && subItems.length > 0) {
|
||||
const selectedSubItemIndex =
|
||||
getSelectedIndexForSubItems(subItems);
|
||||
const hasActiveSubItem = selectedSubItemIndex !== -1;
|
||||
|
||||
return (
|
||||
<NavigationDrawerItemGroup
|
||||
@@ -62,6 +63,7 @@ export const SettingsNavigationDrawerItems = () => {
|
||||
>
|
||||
<SettingsNavigationDrawerItem
|
||||
item={item}
|
||||
hasActiveSubItem={hasActiveSubItem}
|
||||
subItemState={
|
||||
item.indentationLevel
|
||||
? getNavigationSubItemLeftAdornment({
|
||||
|
||||
Reference in New Issue
Block a user