Add feature flag for team accounts in home-menu-navigation

In the home-menu-navigation.tsx file, a feature flag for displaying the Team Accounts section has been implemented leveraging the 'If' component and the flags from the feature-flags.config file. Now, the display of the HomeAccountSelector depends on the status of the 'enableTeamAccounts' flag.
This commit is contained in:
giancarlo
2024-05-10 00:39:48 +07:00
parent 659f1c5416
commit aa01436f0d

View File

@@ -2,9 +2,11 @@ import {
BorderedNavigationMenu,
BorderedNavigationMenuItem,
} from '@kit/ui/bordered-navigation-menu';
import { If } from '@kit/ui/if';
import { AppLogo } from '~/components/app-logo';
import { ProfileAccountDropdownContainer } from '~/components/personal-account-dropdown-container';
import featuresFlagConfig from '~/config/feature-flags.config';
import { personalAccountNavigationConfig } from '~/config/personal-account-navigation.config';
// home imports
@@ -47,7 +49,9 @@ export function HomeMenuNavigation(props: { workspace: UserWorkspace }) {
</div>
<div className={'flex justify-end space-x-2.5'}>
<HomeAccountSelector accounts={accounts} collapsed={false} />
<If condition={featuresFlagConfig.enableTeamAccounts}>
<HomeAccountSelector accounts={accounts} collapsed={false} />
</If>
<UserNotifications userId={user.id} />