Fix: Nav Item Api & Webhook and Functions stay selected (#7628)

Fixed Nav Item Api & Webhook and Functions stay selected like data model
settings.
 Now when clicked stays selected and deos not loose its selection

Fixes #7573


https://github.com/user-attachments/assets/4cb78158-8411-4ee1-9bcc-2870344c0c62

---------

Co-authored-by: ehconitin <nitinkoche03@gmail.com>
Co-authored-by: Félix Malfait <felix@twenty.com>
This commit is contained in:
Tushar Ranjan
2024-10-13 16:48:33 +05:30
committed by GitHub
parent 38d7f0bc6b
commit ccdef0e97b
2 changed files with 4 additions and 6 deletions

View File

@ -21,7 +21,7 @@ export const SettingsNavigationDrawerItem = ({
Icon,
label,
indentationLevel,
matchSubPages = false,
matchSubPages = true,
path,
soon,
subItemState,

View File

@ -43,8 +43,8 @@ type SettingsNavigationItem = {
label: string;
path: SettingsPath;
Icon: IconComponent;
matchSubPages?: boolean;
indentationLevel?: NavigationDrawerItemIndentationLevel;
matchSubPages?: boolean;
};
const StyledIconContainer = styled.div`
@ -90,14 +90,12 @@ export const SettingsNavigationDrawerItems = () => {
label: 'Emails',
path: SettingsPath.AccountsEmails,
Icon: IconMail,
matchSubPages: true,
indentationLevel: 2,
},
{
label: 'Calendars',
path: SettingsPath.AccountsCalendars,
Icon: IconCalendarEvent,
matchSubPages: true,
indentationLevel: 2,
},
];
@ -109,7 +107,7 @@ export const SettingsNavigationDrawerItems = () => {
return matchPath(
{
path: pathName,
end: !accountSubSetting.matchSubPages,
end: !accountSubSetting.matchSubPages ?? true,
},
currentPathName,
);
@ -134,6 +132,7 @@ export const SettingsNavigationDrawerItems = () => {
label="Accounts"
path={SettingsPath.Accounts}
Icon={IconAt}
matchSubPages={false}
/>
{accountSubSettings.map((navigationItem, index) => (
<SettingsNavigationDrawerItem
@ -174,7 +173,6 @@ export const SettingsNavigationDrawerItems = () => {
label="Data model"
path={SettingsPath.Objects}
Icon={IconHierarchy2}
matchSubPages
/>
<SettingsNavigationDrawerItem
label="Integrations"