import React from 'react'; import { Button, styled } from '@jarvisnetwork/ui'; import { ChainId } from '@jarvisnetwork/core-sdk'; import { ModalContainer } from '../ModalComponents'; import { supportedNetworkIds } from '../../config/network'; const ButtonsContainer = styled.div` display: flex; justify-content: space-between; `; const supportedNetworkIdsFragment = supportedNetworkIds.length === 1 ? ( {ChainId[supportedNetworkIds[0]]} ) : supportedNetworkIds.length === 2 ? ( <> {ChainId[supportedNetworkIds[0]]} or{' '} {ChainId[supportedNetworkIds[1]]} > ) : ( supportedNetworkIds.reduce<(JSX.Element | string)[]>( (result, id, index, array) => { result.push({ChainId[supportedNetworkIds[id]]}); if (index === array.length - 2) { result.push(', or '); } else if (index !== array.length - 1) { result.push(', '); } return result; }, [] ) ); export function UnsupportedNetwork({ handleDismiss, handleSwitchWallet, }: { handleDismiss(): void; handleSwitchWallet(): void; }): JSX.Element { return ( You must change networks We've detected that you need to switch your wallet's network to {supportedNetworkIdsFragment}. Some wallets may not support changing networks. If you can not change networks in your wallet you may consider switching to a different wallet. Switch Wallet Dismiss ); }
We've detected that you need to switch your wallet's network to {supportedNetworkIdsFragment}.
Some wallets may not support changing networks. If you can not change networks in your wallet you may consider switching to a different wallet.