Skip to content

Commit

Permalink
Creted inversed object map
Browse files Browse the repository at this point in the history
  • Loading branch information
Freshenext committed Sep 15, 2023
1 parent 9ed755d commit 09128af
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/screens/settings/SettingsScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ import { ChainTypeEnum, chainTypesById } from 'shared/constants/chainConstants'
import { GlobalErrorHandlerContext } from 'components/GlobalErrorHandler/GlobalErrorHandlerContext'
import { getCurrentChainId, setCurrentChainId } from 'storage/ChainStorage'

const ChainTypesInversed = {
[ChainTypeEnum.TESTNET]: ChainTypeEnum.MAINNET,
[ChainTypeEnum.MAINNET]: ChainTypeEnum.TESTNET,
}

export const SettingsScreen = ({
navigation,
}: SettingsScreenProps<settingsStackRouteNames.SettingsScreen>) => {
Expand Down Expand Up @@ -145,10 +150,7 @@ export const SettingsScreen = ({
style={styles.settingsItem}
onPress={onSwitchChains}>
<Typography type={'h3'}>
Switch to{' '}
{chainType === ChainTypeEnum.MAINNET
? ChainTypeEnum.TESTNET
: ChainTypeEnum.MAINNET}
Switch to {ChainTypesInversed[chainType]}
</Typography>
</AppTouchable>
<View style={styles.bottomView}>
Expand Down

0 comments on commit 09128af

Please sign in to comment.