Skip to content

Commit

Permalink
feat: add feature flag for the swap route
Browse files Browse the repository at this point in the history
  • Loading branch information
gleiser-oliveira committed Nov 10, 2023
1 parent dbb2a9a commit 6b2ef76
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/containers/Layout/useGetMenuItems.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { MenuItem } from './types';
const useGetMenuItems = () => {
const { accountAddress } = useAuth();
const corePoolRouteEnabled = useIsFeatureEnabled({ name: 'corePoolRoute' });
const swapRouteEnabled = useIsFeatureEnabled({ name: 'swapRoute' });
const historyRouteEnabled = useIsFeatureEnabled({ name: 'historyRoute' });
const convertVrtRouteEnabled = useIsFeatureEnabled({ name: 'convertVrtRoute' });
const vaiRouteEnabled = useIsFeatureEnabled({ name: 'vaiRoute' });
Expand Down Expand Up @@ -60,14 +61,17 @@ const useGetMenuItems = () => {
i18nKey: 'layout.menuItems.vaults',
iconName: 'vault',
},
{
);

if (swapRouteEnabled) {
menuItems.push({
to: routes.swap.path,
// Translation key: do not remove this comment
// t('layout.menuItems.swap')
i18nKey: 'layout.menuItems.swap',
iconName: 'convert',
},
);
});
}

if (historyRouteEnabled) {
menuItems.push({
Expand Down
1 change: 1 addition & 0 deletions src/hooks/useIsFeatureEnabled/__tests__/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ describe('useIsFeatureEnabled', () => {
'corePoolMarketRoute',
'historyRoute',
'convertVrtRoute',
'swapRoute',
'vaiRoute',
];

Expand Down
1 change: 1 addition & 0 deletions src/hooks/useIsFeatureEnabled/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const featureFlags = {
convertVrtRoute: [ChainId.BSC_MAINNET, ChainId.BSC_TESTNET],
historyRoute: [ChainId.BSC_MAINNET, ChainId.BSC_TESTNET],
vaiRoute: [ChainId.BSC_MAINNET, ChainId.BSC_TESTNET],
swapRoute: [ChainId.BSC_MAINNET, ChainId.BSC_TESTNET],
createProposal: [ChainId.BSC_MAINNET, ChainId.BSC_TESTNET],
};

Expand Down

0 comments on commit 6b2ef76

Please sign in to comment.