Skip to content

Commit

Permalink
chore(drawer-menu): use swap screen remote config for celo menu item …
Browse files Browse the repository at this point in the history
…position (#2716)

### Description

From Ellen's feedback from demo, seems like we also want to control the CELO drawer menu item position with the same remote config flag as the swap menu item. This was missed in the requirements.

### Other changes

N/A

### Tested

Manually

### How others should test

The CELO item should be the second drawer menu item (i.e. on Mainnet). If the swap menu item is displayed (i.e. in Alfajores), then the CELO item should be after "add & withdraw". 

### Related issues

- Relates to RET-319

### Backwards compatibility

Yes
  • Loading branch information
kathaypacific authored Jul 21, 2022
1 parent d6bd8a4 commit 27e0875
Showing 1 changed file with 43 additions and 17 deletions.
60 changes: 43 additions & 17 deletions src/navigator/DrawerNavigator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -225,13 +225,34 @@ export default function DrawerNavigator() {
component={WalletHome}
options={{ title: t('home'), drawerIcon: Home, unmountOnBlur: false }}
/>
{shouldShowSwapMenuInDrawerMenu && (
{shouldShowSwapMenuInDrawerMenu ? (
<Drawer.Screen
name={Screens.SwapScreen}
component={() => null}
options={{ title: t('swap'), drawerIcon: Swap }}
/>
) : (
<>
{(isCeloEducationComplete && (
<Drawer.Screen
name={Screens.ExchangeHomeScreen}
component={ExchangeHomeScreen}
options={{ title: t('celoGold'), drawerIcon: Gold }}
/>
)) || (
<Drawer.Screen
name={Screens.GoldEducation}
component={GoldEducation}
options={{
title: t('celoGold'),
drawerIcon: Gold,
...TransitionPresets.ModalTransition,
}}
/>
)}
</>
)}

{dappsListUrl && (
<Drawer.Screen
name={Screens.DAppsExplorerScreen}
Expand Down Expand Up @@ -281,23 +302,28 @@ export default function DrawerNavigator() {
options={{ title: t('invite'), drawerIcon: Invite }}
/>
)}
{(isCeloEducationComplete && (
<Drawer.Screen
name={Screens.ExchangeHomeScreen}
component={ExchangeHomeScreen}
options={{ title: t('celoGold'), drawerIcon: Gold }}
/>
)) || (
<Drawer.Screen
name={Screens.GoldEducation}
component={GoldEducation}
options={{
title: t('celoGold'),
drawerIcon: Gold,
...TransitionPresets.ModalTransition,
}}
/>
{shouldShowSwapMenuInDrawerMenu && (
<>
{(isCeloEducationComplete && (
<Drawer.Screen
name={Screens.ExchangeHomeScreen}
component={ExchangeHomeScreen}
options={{ title: t('celoGold'), drawerIcon: Gold }}
/>
)) || (
<Drawer.Screen
name={Screens.GoldEducation}
component={GoldEducation}
options={{
title: t('celoGold'),
drawerIcon: Gold,
...TransitionPresets.ModalTransition,
}}
/>
)}
</>
)}

<Drawer.Screen
name={Screens.Settings}
component={SettingsScreen}
Expand Down

0 comments on commit 27e0875

Please sign in to comment.