Files
twenty/packages/twenty-front/src/modules/settings/components/SettingsNavigationDrawerItems.tsx
T
martmull b9c8d607aa Test revert crm integration (#6321)
PR to test revert integration in production
2024-07-25 09:38:55 +02:00

132 lines
4.0 KiB
TypeScript

import { useRecoilValue } from 'recoil';
import {
IconApps,
IconAt,
IconCalendarEvent,
IconCode,
IconColorSwatch,
IconCurrencyDollar,
IconDoorEnter,
IconHierarchy2,
IconMail,
IconRocket,
IconSettings,
IconUserCircle,
IconUsers,
} from 'twenty-ui';
import { useAuth } from '@/auth/hooks/useAuth';
import { billingState } from '@/client-config/states/billingState';
import { SettingsNavigationDrawerItem } from '@/settings/components/SettingsNavigationDrawerItem';
import { SettingsPath } from '@/types/SettingsPath';
import { NavigationDrawerItem } from '@/ui/navigation/navigation-drawer/components/NavigationDrawerItem';
import { NavigationDrawerItemGroup } from '@/ui/navigation/navigation-drawer/components/NavigationDrawerItemGroup';
import { NavigationDrawerSection } from '@/ui/navigation/navigation-drawer/components/NavigationDrawerSection';
import { NavigationDrawerSectionTitle } from '@/ui/navigation/navigation-drawer/components/NavigationDrawerSectionTitle';
import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';
export const SettingsNavigationDrawerItems = () => {
const { signOut } = useAuth();
const billing = useRecoilValue(billingState);
const isCRMMigrationEnabled = useIsFeatureEnabled('IS_CRM_MIGRATION_ENABLED');
return (
<>
<NavigationDrawerSection>
<NavigationDrawerSectionTitle label="User" />
<SettingsNavigationDrawerItem
label="Profile"
path={SettingsPath.ProfilePage}
Icon={IconUserCircle}
/>
<SettingsNavigationDrawerItem
label="Appearance"
path={SettingsPath.Appearance}
Icon={IconColorSwatch}
/>
<NavigationDrawerItemGroup>
<SettingsNavigationDrawerItem
label="Accounts"
path={SettingsPath.Accounts}
Icon={IconAt}
/>
<SettingsNavigationDrawerItem
level={2}
label="Emails"
path={SettingsPath.AccountsEmails}
Icon={IconMail}
matchSubPages
/>
<SettingsNavigationDrawerItem
level={2}
label="Calendars"
path={SettingsPath.AccountsCalendars}
Icon={IconCalendarEvent}
matchSubPages
/>
</NavigationDrawerItemGroup>
</NavigationDrawerSection>
<NavigationDrawerSection>
<NavigationDrawerSectionTitle label="Workspace" />
<SettingsNavigationDrawerItem
label="General"
path={SettingsPath.Workspace}
Icon={IconSettings}
/>
<SettingsNavigationDrawerItem
label="Members"
path={SettingsPath.WorkspaceMembersPage}
Icon={IconUsers}
/>
{billing?.isBillingEnabled && (
<SettingsNavigationDrawerItem
label="Billing"
path={SettingsPath.Billing}
Icon={IconCurrencyDollar}
/>
)}
<SettingsNavigationDrawerItem
label="Data model"
path={SettingsPath.Objects}
Icon={IconHierarchy2}
matchSubPages
/>
<SettingsNavigationDrawerItem
label="Developers"
path={SettingsPath.Developers}
Icon={IconCode}
/>
<SettingsNavigationDrawerItem
label="Integrations"
path={SettingsPath.Integrations}
Icon={IconApps}
/>
{isCRMMigrationEnabled && (
<SettingsNavigationDrawerItem
label="CRM Migration"
path={SettingsPath.CRMMigration}
Icon={IconCode}
/>
)}
</NavigationDrawerSection>
<NavigationDrawerSection>
<NavigationDrawerSectionTitle label="Other" />
<SettingsNavigationDrawerItem
label="Releases"
path={SettingsPath.Releases}
Icon={IconRocket}
/>
<NavigationDrawerItem
label="Logout"
onClick={signOut}
Icon={IconDoorEnter}
/>
</NavigationDrawerSection>
</>
);
};