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, Icon,
label, label,
indentationLevel, indentationLevel,
matchSubPages = false, matchSubPages = true,
path, path,
soon, soon,
subItemState, subItemState,

View File

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