Commit 0e3c9570 authored by cartcrom's avatar cartcrom Committed by GitHub

style: updating ui on unsupported network (#4138)

* initial changes

* disabled all swap ui buttons when on unsupported chain

* implementing Cal's requests to change sizing and copy on pools

* updated snapshots

* reverted changed snapshots

* updated unsupported network test

* fixing deprecated colors missing
parent d5e4e21a
...@@ -4,6 +4,7 @@ import { Pair } from '@uniswap/v2-sdk' ...@@ -4,6 +4,7 @@ import { Pair } from '@uniswap/v2-sdk'
import { useWeb3React } from '@web3-react/core' import { useWeb3React } from '@web3-react/core'
import { AutoColumn } from 'components/Column' import { AutoColumn } from 'components/Column'
import { LoadingOpacityContainer, loadingOpacityMixin } from 'components/Loader/styled' import { LoadingOpacityContainer, loadingOpacityMixin } from 'components/Loader/styled'
import { isSupportedChain } from 'constants/chains'
import { darken } from 'polished' import { darken } from 'polished'
import { ReactNode, useCallback, useState } from 'react' import { ReactNode, useCallback, useState } from 'react'
import { Lock } from 'react-feather' import { Lock } from 'react-feather'
...@@ -45,20 +46,30 @@ const FixedContainer = styled.div` ...@@ -45,20 +46,30 @@ const FixedContainer = styled.div`
z-index: 2; z-index: 2;
` `
const Container = styled.div<{ hideInput: boolean }>` const Container = styled.div<{ hideInput: boolean; disabled: boolean }>`
border-radius: ${({ hideInput }) => (hideInput ? '16px' : '20px')}; border-radius: ${({ hideInput }) => (hideInput ? '16px' : '20px')};
border: 1px solid ${({ theme }) => theme.deprecated_bg0}; border: 1px solid ${({ theme }) => theme.deprecated_bg0};
background-color: ${({ theme }) => theme.deprecated_bg1}; background-color: ${({ theme }) => theme.deprecated_bg1};
width: ${({ hideInput }) => (hideInput ? '100%' : 'initial')}; width: ${({ hideInput }) => (hideInput ? '100%' : 'initial')};
:focus, ${({ theme, hideInput, disabled }) =>
:hover { !disabled &&
border: 1px solid ${({ theme, hideInput }) => (hideInput ? ' transparent' : theme.deprecated_bg3)}; `
} :focus,
:hover {
border: 1px solid ${hideInput ? ' transparent' : theme.deprecated_bg3};
}
`}
` `
const CurrencySelect = styled(ButtonGray)<{ visible: boolean; selected: boolean; hideInput?: boolean }>` const CurrencySelect = styled(ButtonGray)<{
visible: boolean
selected: boolean
hideInput?: boolean
disabled?: boolean
}>`
align-items: center; align-items: center;
background-color: ${({ selected, theme }) => (selected ? theme.deprecated_bg2 : theme.deprecated_primary1)}; background-color: ${({ selected, theme }) => (selected ? theme.deprecated_bg2 : theme.deprecated_primary1)};
opacity: ${({ disabled }) => (!disabled ? 1 : 0.4)};
box-shadow: ${({ selected }) => (selected ? 'none' : '0px 6px 10px rgba(0, 0, 0, 0.075)')}; box-shadow: ${({ selected }) => (selected ? 'none' : '0px 6px 10px rgba(0, 0, 0, 0.075)')};
box-shadow: 0px 6px 10px rgba(0, 0, 0, 0.075); box-shadow: 0px 6px 10px rgba(0, 0, 0, 0.075);
color: ${({ selected, theme }) => (selected ? theme.deprecated_text1 : theme.deprecated_white)}; color: ${({ selected, theme }) => (selected ? theme.deprecated_text1 : theme.deprecated_white)};
...@@ -203,7 +214,7 @@ export default function CurrencyInputPanel({ ...@@ -203,7 +214,7 @@ export default function CurrencyInputPanel({
...rest ...rest
}: CurrencyInputPanelProps) { }: CurrencyInputPanelProps) {
const [modalOpen, setModalOpen] = useState(false) const [modalOpen, setModalOpen] = useState(false)
const { account } = useWeb3React() const { account, chainId } = useWeb3React()
const selectedCurrencyBalance = useCurrencyBalance(account ?? undefined, currency ?? undefined) const selectedCurrencyBalance = useCurrencyBalance(account ?? undefined, currency ?? undefined)
const theme = useTheme() const theme = useTheme()
...@@ -211,6 +222,8 @@ export default function CurrencyInputPanel({ ...@@ -211,6 +222,8 @@ export default function CurrencyInputPanel({
setModalOpen(false) setModalOpen(false)
}, [setModalOpen]) }, [setModalOpen])
const chainAllowed = isSupportedChain(chainId)
return ( return (
<InputPanel id={id} hideInput={hideInput} {...rest}> <InputPanel id={id} hideInput={hideInput} {...rest}>
{locked && ( {locked && (
...@@ -223,18 +236,20 @@ export default function CurrencyInputPanel({ ...@@ -223,18 +236,20 @@ export default function CurrencyInputPanel({
</AutoColumn> </AutoColumn>
</FixedContainer> </FixedContainer>
)} )}
<Container hideInput={hideInput}> <Container hideInput={hideInput} disabled={!chainAllowed}>
<InputRow style={hideInput ? { padding: '0', borderRadius: '8px' } : {}} selected={!onCurrencySelect}> <InputRow style={hideInput ? { padding: '0', borderRadius: '8px' } : {}} selected={!onCurrencySelect}>
{!hideInput && ( {!hideInput && (
<StyledNumericalInput <StyledNumericalInput
className="token-amount-input" className="token-amount-input"
value={value} value={value}
onUserInput={onUserInput} onUserInput={onUserInput}
disabled={!chainAllowed}
$loading={loading} $loading={loading}
/> />
)} )}
<CurrencySelect <CurrencySelect
disabled={!chainAllowed}
visible={currency !== undefined} visible={currency !== undefined}
selected={!!currency} selected={!!currency}
hideInput={hideInput} hideInput={hideInput}
......
...@@ -5,9 +5,10 @@ import { getChainInfo } from 'constants/chainInfo' ...@@ -5,9 +5,10 @@ import { getChainInfo } from 'constants/chainInfo'
import { CHAIN_IDS_TO_NAMES, SupportedChainId } from 'constants/chains' import { CHAIN_IDS_TO_NAMES, SupportedChainId } from 'constants/chains'
import useParsedQueryString from 'hooks/useParsedQueryString' import useParsedQueryString from 'hooks/useParsedQueryString'
import usePrevious from 'hooks/usePrevious' import usePrevious from 'hooks/usePrevious'
import { darken } from 'polished'
import { ParsedQs } from 'qs' import { ParsedQs } from 'qs'
import { useCallback, useEffect, useRef, useState } from 'react' import { useCallback, useEffect, useRef, useState } from 'react'
import { ArrowDownCircle, ChevronDown } from 'react-feather' import { AlertTriangle, ArrowDownCircle, ChevronDown } from 'react-feather'
import { useHistory } from 'react-router-dom' import { useHistory } from 'react-router-dom'
import { useCloseModal, useModalIsOpen, useOpenModal, useToggleModal } from 'state/application/hooks' import { useCloseModal, useModalIsOpen, useOpenModal, useToggleModal } from 'state/application/hooks'
import { addPopup, ApplicationModal } from 'state/application/reducer' import { addPopup, ApplicationModal } from 'state/application/reducer'
...@@ -121,7 +122,20 @@ const SelectorLabel = styled(NetworkLabel)` ...@@ -121,7 +122,20 @@ const SelectorLabel = styled(NetworkLabel)`
margin-right: 8px; margin-right: 8px;
} }
` `
const SelectorControls = styled.div` const NetworkAlertLabel = styled(NetworkLabel)`
display: none;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
margin: 0 0.5rem 0 0.4rem;
font-size: 1rem;
width: fit-content;
font-weight: 500;
@media screen and (min-width: ${MEDIA_WIDTHS.upToSmall}px) {
display: block;
}
`
const SelectorControls = styled.div<{ supportedChain: boolean }>`
align-items: center; align-items: center;
background-color: ${({ theme }) => theme.deprecated_bg0}; background-color: ${({ theme }) => theme.deprecated_bg0};
border: 2px solid ${({ theme }) => theme.deprecated_bg0}; border: 2px solid ${({ theme }) => theme.deprecated_bg0};
...@@ -131,6 +145,16 @@ const SelectorControls = styled.div` ...@@ -131,6 +145,16 @@ const SelectorControls = styled.div`
font-weight: 500; font-weight: 500;
justify-content: space-between; justify-content: space-between;
padding: 6px 8px; padding: 6px 8px;
${({ supportedChain, theme }) =>
!supportedChain &&
`
color: ${theme.deprecated_white};
background-color: ${theme.deprecated_red1};
border: 2px solid ${theme.deprecated_red1};
`}
:focus {
background-color: ${({ theme }) => darken(0.1, theme.deprecated_red1)};
}
` `
const SelectorLogo = styled(Logo)` const SelectorLogo = styled(Logo)`
@media screen and (min-width: ${MEDIA_WIDTHS.upToSmall}px) { @media screen and (min-width: ${MEDIA_WIDTHS.upToSmall}px) {
...@@ -145,6 +169,14 @@ const SelectorWrapper = styled.div` ...@@ -145,6 +169,14 @@ const SelectorWrapper = styled.div`
const StyledChevronDown = styled(ChevronDown)` const StyledChevronDown = styled(ChevronDown)`
width: 16px; width: 16px;
` `
const NetworkIcon = styled(AlertTriangle)`
margin-left: 0.25rem;
margin-right: 0.25rem;
width: 16px;
height: 16px;
`
const BridgeLabel = ({ chainId }: { chainId: SupportedChainId }) => { const BridgeLabel = ({ chainId }: { chainId: SupportedChainId }) => {
switch (chainId) { switch (chainId) {
case SupportedChainId.ARBITRUM_ONE: case SupportedChainId.ARBITRUM_ONE:
...@@ -354,10 +386,12 @@ export default function NetworkSelector() { ...@@ -354,10 +386,12 @@ export default function NetworkSelector() {
} }
}, [onSelectChain, urlChainId, previousUrlChainId, isActive]) }, [onSelectChain, urlChainId, previousUrlChainId, isActive])
if (!chainId || !info || !provider) { if (!chainId || !provider) {
return null return null
} }
const onSupportedChain = info !== undefined
return ( return (
<SelectorWrapper <SelectorWrapper
ref={node} ref={node}
...@@ -365,16 +399,26 @@ export default function NetworkSelector() { ...@@ -365,16 +399,26 @@ export default function NetworkSelector() {
onMouseLeave={closeModal} onMouseLeave={closeModal}
onClick={isMobile ? toggleModal : undefined} onClick={isMobile ? toggleModal : undefined}
> >
<SelectorControls> <SelectorControls supportedChain={onSupportedChain}>
<SelectorLogo src={info.logoUrl} /> {onSupportedChain ? (
<SelectorLabel>{info.label}</SelectorLabel> <>
<StyledChevronDown /> <SelectorLogo src={info.logoUrl} />
<SelectorLabel>{info.label}</SelectorLabel>
<StyledChevronDown />
</>
) : (
<>
<NetworkIcon />
<NetworkAlertLabel>Switch Network</NetworkAlertLabel>
<StyledChevronDown />
</>
)}
</SelectorControls> </SelectorControls>
{isOpen && ( {isOpen && (
<FlyoutMenu> <FlyoutMenu>
<FlyoutMenuContents> <FlyoutMenuContents>
<FlyoutHeader> <FlyoutHeader>
<Trans>Select a network</Trans> <Trans>Select a {!onSupportedChain ? ' supported ' : ''}network</Trans>
</FlyoutHeader> </FlyoutHeader>
{NETWORK_SELECTOR_CHAINS.map((chainId: SupportedChainId) => {NETWORK_SELECTOR_CHAINS.map((chainId: SupportedChainId) =>
isChainAllowed(connector, chainId) ? ( isChainAllowed(connector, chainId) ? (
......
...@@ -328,7 +328,7 @@ export default function Header() { ...@@ -328,7 +328,7 @@ export default function Header() {
)} )}
<AccountElement active={!!account}> <AccountElement active={!!account}>
{account && userEthBalance ? ( {account && userEthBalance ? (
<BalanceText style={{ flexShrink: 0, userSelect: 'none' }} pl="0.75rem" pr="0.5rem" fontWeight={500}> <BalanceText style={{ flexShrink: 0, userSelect: 'none' }} pl="0.75rem" pr=".4rem" fontWeight={500}>
<Trans> <Trans>
{userEthBalance?.toSignificant(3)} {nativeCurrencySymbol} {userEthBalance?.toSignificant(3)} {nativeCurrencySymbol}
</Trans> </Trans>
......
...@@ -29,10 +29,6 @@ const StyledMenuIcon = styled(Settings)` ...@@ -29,10 +29,6 @@ const StyledMenuIcon = styled(Settings)`
> * { > * {
stroke: ${({ theme }) => theme.deprecated_text1}; stroke: ${({ theme }) => theme.deprecated_text1};
} }
:hover {
opacity: 0.7;
}
` `
const StyledCloseIcon = styled(X)` const StyledCloseIcon = styled(X)`
...@@ -47,7 +43,7 @@ const StyledCloseIcon = styled(X)` ...@@ -47,7 +43,7 @@ const StyledCloseIcon = styled(X)`
} }
` `
const StyledMenuButton = styled.button` const StyledMenuButton = styled.button<{ disabled: boolean }>`
position: relative; position: relative;
width: 100%; width: 100%;
height: 100%; height: 100%;
...@@ -58,11 +54,16 @@ const StyledMenuButton = styled.button` ...@@ -58,11 +54,16 @@ const StyledMenuButton = styled.button`
border-radius: 0.5rem; border-radius: 0.5rem;
height: 20px; height: 20px;
:hover, ${({ disabled }) =>
:focus { !disabled &&
cursor: pointer; `
outline: none; :hover,
} :focus {
cursor: pointer;
outline: none;
opacity: 0.7;
}
`}
` `
const EmojiWrapper = styled.div` const EmojiWrapper = styled.div`
position: absolute; position: absolute;
...@@ -179,7 +180,12 @@ export default function SettingsTab({ placeholderSlippage }: { placeholderSlippa ...@@ -179,7 +180,12 @@ export default function SettingsTab({ placeholderSlippage }: { placeholderSlippa
</AutoColumn> </AutoColumn>
</ModalContentWrapper> </ModalContentWrapper>
</Modal> </Modal>
<StyledMenuButton onClick={toggle} id="open-settings-dialog-button" aria-label={t`Transaction Settings`}> <StyledMenuButton
disabled={!isSupportedChainId(chainId)}
onClick={toggle}
id="open-settings-dialog-button"
aria-label={t`Transaction Settings`}
>
<StyledMenuIcon /> <StyledMenuIcon />
{expertMode ? ( {expertMode ? (
<EmojiWrapper> <EmojiWrapper>
......
...@@ -7,11 +7,10 @@ import { getConnection } from 'connection/utils' ...@@ -7,11 +7,10 @@ import { getConnection } from 'connection/utils'
import { getIsValidSwapQuote } from 'pages/Swap' import { getIsValidSwapQuote } from 'pages/Swap'
import { darken } from 'polished' import { darken } from 'polished'
import { useMemo } from 'react' import { useMemo } from 'react'
import { Activity } from 'react-feather' import { AlertTriangle } from 'react-feather'
import { useAppSelector } from 'state/hooks' import { useAppSelector } from 'state/hooks'
import { useDerivedSwapInfo } from 'state/swap/hooks' import { useDerivedSwapInfo } from 'state/swap/hooks'
import styled, { css } from 'styled-components/macro' import styled, { css } from 'styled-components/macro'
import { isChainAllowed } from 'utils/switchChain'
import { useHasSocks } from '../../hooks/useSocksBalance' import { useHasSocks } from '../../hooks/useSocksBalance'
import { useToggleWalletModal } from '../../state/application/hooks' import { useToggleWalletModal } from '../../state/application/hooks'
...@@ -34,7 +33,7 @@ const Web3StatusGeneric = styled(ButtonSecondary)` ...@@ -34,7 +33,7 @@ const Web3StatusGeneric = styled(ButtonSecondary)`
user-select: none; user-select: none;
height: 36px; height: 36px;
margin-right: 2px; margin-right: 2px;
margin-left: 1px; margin-left: 2px;
:focus { :focus {
outline: none; outline: none;
} }
...@@ -106,7 +105,7 @@ const Text = styled.p` ...@@ -106,7 +105,7 @@ const Text = styled.p`
font-weight: 500; font-weight: 500;
` `
const NetworkIcon = styled(Activity)` const NetworkIcon = styled(AlertTriangle)`
margin-left: 0.25rem; margin-left: 0.25rem;
margin-right: 0.5rem; margin-right: 0.5rem;
width: 16px; width: 16px;
...@@ -137,8 +136,6 @@ function Web3StatusInner() { ...@@ -137,8 +136,6 @@ function Web3StatusInner() {
const error = useAppSelector((state) => state.connection.errorByConnectionType[getConnection(connector).type]) const error = useAppSelector((state) => state.connection.errorByConnectionType[getConnection(connector).type])
const chainAllowed = chainId && isChainAllowed(connector, chainId)
const allTransactions = useAllTransactions() const allTransactions = useAllTransactions()
const sortedRecentTransactions = useMemo(() => { const sortedRecentTransactions = useMemo(() => {
...@@ -154,15 +151,6 @@ function Web3StatusInner() { ...@@ -154,15 +151,6 @@ function Web3StatusInner() {
if (!chainId) { if (!chainId) {
return null return null
} else if (!chainAllowed) {
return (
<Web3StatusError onClick={toggleWalletModal}>
<NetworkIcon />
<Text>
<Trans>Wrong Network</Trans>
</Text>
</Web3StatusError>
)
} else if (error) { } else if (error) {
return ( return (
<Web3StatusError onClick={toggleWalletModal}> <Web3StatusError onClick={toggleWalletModal}>
......
...@@ -44,6 +44,10 @@ export const ALL_SUPPORTED_CHAIN_IDS: SupportedChainId[] = Object.values(Support ...@@ -44,6 +44,10 @@ export const ALL_SUPPORTED_CHAIN_IDS: SupportedChainId[] = Object.values(Support
(id) => typeof id === 'number' (id) => typeof id === 'number'
) as SupportedChainId[] ) as SupportedChainId[]
export function isSupportedChain(chainId: number | undefined): chainId is SupportedChainId {
return !!chainId && !!SupportedChainId[chainId]
}
export const SUPPORTED_GAS_ESTIMATE_CHAIN_IDS = [ export const SUPPORTED_GAS_ESTIMATE_CHAIN_IDS = [
SupportedChainId.MAINNET, SupportedChainId.MAINNET,
SupportedChainId.POLYGON, SupportedChainId.POLYGON,
......
import * as chains from 'constants/chains'
import * as useV3Positions from 'hooks/useV3Positions' import * as useV3Positions from 'hooks/useV3Positions'
import { BrowserRouter as Router } from 'react-router-dom' import { BrowserRouter as Router } from 'react-router-dom'
import { render, screen } from 'test-utils' import { render, screen } from 'test-utils'
import * as switchChain from 'utils/switchChain'
import Pool from '.' import Pool from '.'
...@@ -17,7 +17,7 @@ jest.mock('@web3-react/core', () => { ...@@ -17,7 +17,7 @@ jest.mock('@web3-react/core', () => {
describe('networks', () => { describe('networks', () => {
it('renders error card when unsupported chain is selected', () => { it('renders error card when unsupported chain is selected', () => {
jest.spyOn(switchChain, 'isChainAllowed').mockReturnValue(false) jest.spyOn(chains, 'isSupportedChain').mockReturnValue(false)
jest.spyOn(useV3Positions, 'useV3Positions').mockImplementation(() => { jest.spyOn(useV3Positions, 'useV3Positions').mockImplementation(() => {
return { loading: false, positions: undefined } return { loading: false, positions: undefined }
}) })
...@@ -27,13 +27,11 @@ describe('networks', () => { ...@@ -27,13 +27,11 @@ describe('networks', () => {
<Pool /> <Pool />
</Router> </Router>
) )
expect( expect(screen.getByText('Your connected network is unsupported.')).toBeInTheDocument()
screen.getByText('Your connected network is unsupported. Request support', { exact: false })
).toBeInTheDocument()
}) })
it('renders empty positions card when on supported chain with no positions', () => { it('renders empty positions card when on supported chain with no positions', () => {
jest.spyOn(switchChain, 'isChainAllowed').mockReturnValue(true) jest.spyOn(chains, 'isSupportedChain').mockReturnValue(true)
jest.spyOn(useV3Positions, 'useV3Positions').mockImplementation(() => { jest.spyOn(useV3Positions, 'useV3Positions').mockImplementation(() => {
return { loading: false, positions: undefined } return { loading: false, positions: undefined }
}) })
......
...@@ -11,16 +11,16 @@ import { SwapPoolTabs } from 'components/NavigationTabs' ...@@ -11,16 +11,16 @@ import { SwapPoolTabs } from 'components/NavigationTabs'
import PositionList from 'components/PositionList' import PositionList from 'components/PositionList'
import { RowBetween, RowFixed } from 'components/Row' import { RowBetween, RowFixed } from 'components/Row'
import { SwitchLocaleLink } from 'components/SwitchLocaleLink' import { SwitchLocaleLink } from 'components/SwitchLocaleLink'
import { isSupportedChain } from 'constants/chains'
import { useV3Positions } from 'hooks/useV3Positions' import { useV3Positions } from 'hooks/useV3Positions'
import { useContext } from 'react' import { useContext } from 'react'
import { Activity, BookOpen, ChevronDown, ChevronsRight, Inbox, Layers, PlusCircle } from 'react-feather' import { AlertTriangle, BookOpen, ChevronDown, ChevronsRight, Inbox, Layers, PlusCircle } from 'react-feather'
import { Link } from 'react-router-dom' import { Link } from 'react-router-dom'
import { useToggleWalletModal } from 'state/application/hooks' import { useToggleWalletModal } from 'state/application/hooks'
import { useUserHideClosedPositions } from 'state/user/hooks' import { useUserHideClosedPositions } from 'state/user/hooks'
import styled, { css, ThemeContext } from 'styled-components/macro' import styled, { css, ThemeContext } from 'styled-components/macro'
import { ExternalLink, HideSmall, ThemedText } from 'theme' import { HideSmall, ThemedText } from 'theme'
import { PositionDetails } from 'types/position' import { PositionDetails } from 'types/position'
import { isChainAllowed } from 'utils/switchChain'
import { V2_FACTORY_ADDRESSES } from '../../constants/addresses' import { V2_FACTORY_ADDRESSES } from '../../constants/addresses'
import CTACards from './CTACards' import CTACards from './CTACards'
...@@ -107,7 +107,7 @@ const IconStyle = css` ...@@ -107,7 +107,7 @@ const IconStyle = css`
margin-bottom: 0.5rem; margin-bottom: 0.5rem;
` `
const NetworkIcon = styled(Activity)` const NetworkIcon = styled(AlertTriangle)`
${IconStyle} ${IconStyle}
` `
...@@ -171,10 +171,7 @@ function WrongNetworkCard() { ...@@ -171,10 +171,7 @@ function WrongNetworkCard() {
<ThemedText.Body color={theme.deprecated_text3} textAlign="center"> <ThemedText.Body color={theme.deprecated_text3} textAlign="center">
<NetworkIcon strokeWidth={1.2} /> <NetworkIcon strokeWidth={1.2} />
<div data-testid="pools-unsupported-err"> <div data-testid="pools-unsupported-err">
<Trans> <Trans>Your connected network is unsupported.</Trans>
Your connected network is unsupported. Request support{' '}
<ExternalLink href="https://uniswap.canny.io/feature-requests">here</ExternalLink>.
</Trans>
</div> </div>
</ThemedText.Body> </ThemedText.Body>
</ErrorContainer> </ErrorContainer>
...@@ -188,7 +185,7 @@ function WrongNetworkCard() { ...@@ -188,7 +185,7 @@ function WrongNetworkCard() {
} }
export default function Pool() { export default function Pool() {
const { account, chainId, connector } = useWeb3React() const { account, chainId } = useWeb3React()
const toggleWalletModal = useToggleWalletModal() const toggleWalletModal = useToggleWalletModal()
const theme = useContext(ThemeContext) const theme = useContext(ThemeContext)
...@@ -196,7 +193,7 @@ export default function Pool() { ...@@ -196,7 +193,7 @@ export default function Pool() {
const { positions, loading: positionsLoading } = useV3Positions(account) const { positions, loading: positionsLoading } = useV3Positions(account)
if (chainId && !isChainAllowed(connector, chainId)) { if (!isSupportedChain(chainId)) {
return <WrongNetworkCard /> return <WrongNetworkCard />
} }
...@@ -210,7 +207,7 @@ export default function Pool() { ...@@ -210,7 +207,7 @@ export default function Pool() {
const filteredPositions = [...openPositions, ...(userHideClosedPositions ? [] : closedPositions)] const filteredPositions = [...openPositions, ...(userHideClosedPositions ? [] : closedPositions)]
const showConnectAWallet = Boolean(!account) const showConnectAWallet = Boolean(!account)
const showV2Features = Boolean(chainId && V2_FACTORY_ADDRESSES[chainId]) const showV2Features = Boolean(V2_FACTORY_ADDRESSES[chainId])
const menuItems = [ const menuItems = [
{ {
......
...@@ -13,6 +13,7 @@ import { NetworkAlert } from 'components/NetworkAlert/NetworkAlert' ...@@ -13,6 +13,7 @@ import { NetworkAlert } from 'components/NetworkAlert/NetworkAlert'
import SwapDetailsDropdown from 'components/swap/SwapDetailsDropdown' import SwapDetailsDropdown from 'components/swap/SwapDetailsDropdown'
import UnsupportedCurrencyFooter from 'components/swap/UnsupportedCurrencyFooter' import UnsupportedCurrencyFooter from 'components/swap/UnsupportedCurrencyFooter'
import { MouseoverTooltip } from 'components/Tooltip' import { MouseoverTooltip } from 'components/Tooltip'
import { isSupportedChain } from 'constants/chains'
import { useSwapCallback } from 'hooks/useSwapCallback' import { useSwapCallback } from 'hooks/useSwapCallback'
import useTransactionDeadline from 'hooks/useTransactionDeadline' import useTransactionDeadline from 'hooks/useTransactionDeadline'
import JSBI from 'jsbi' import JSBI from 'jsbi'
...@@ -461,7 +462,7 @@ export default function Swap() { ...@@ -461,7 +462,7 @@ export default function Swap() {
loading={independentField === Field.OUTPUT && routeIsSyncing} loading={independentField === Field.OUTPUT && routeIsSyncing}
/> />
</Trace> </Trace>
<ArrowWrapper clickable> <ArrowWrapper clickable={isSupportedChain(chainId)}>
<ArrowDown <ArrowDown
size="16" size="16"
onClick={() => { onClick={() => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment