Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use supported chain set
Browse files Browse the repository at this point in the history
JFrankfurt committed Apr 26, 2023
1 parent 74fce29 commit db4af1f
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/NavBar/ChainSelector.tsx
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ import { MouseoverTooltip } from 'components/Tooltip'
import { ConnectionType } from 'connection'
import { useGetConnection } from 'connection'
import { getChainInfo } from 'constants/chainInfo'
import { SupportedChainId } from 'constants/chains'
import { SupportedChainId, UniWalletSupportedChains } from 'constants/chains'
import { useOnClickOutside } from 'hooks/useOnClickOutside'
import useSelectChain from 'hooks/useSelectChain'
import useSyncChainQuery from 'hooks/useSyncChainQuery'
@@ -76,7 +76,7 @@ export const ChainSelector = ({ leftAlign }: ChainSelectorProps) => {
<Column paddingX="8">
{NETWORK_SELECTOR_CHAINS.map((chainId: SupportedChainId) => (
<ChainSelectorRow
disabled={isUniWallet && [SupportedChainId.CELO, SupportedChainId.BNB].includes(chainId)}
disabled={isUniWallet && !UniWalletSupportedChains.includes(chainId)}
onSelectChain={onSelectChain}
targetChain={chainId}
key={chainId}
7 changes: 7 additions & 0 deletions src/constants/chains.ts
Original file line number Diff line number Diff line change
@@ -25,6 +25,13 @@ export enum SupportedChainId {
BNB = 56,
}

export const UniWalletSupportedChains = [
SupportedChainId.MAINNET,
SupportedChainId.ARBITRUM_ONE,
SupportedChainId.OPTIMISM,
SupportedChainId.POLYGON,
]

export const CHAIN_IDS_TO_NAMES = {
[SupportedChainId.MAINNET]: 'mainnet',
[SupportedChainId.GOERLI]: 'goerli',

0 comments on commit db4af1f

Please sign in to comment.