Commit 9f33ed06 authored by lynn's avatar lynn Committed by GitHub

fix: improve network switching error to new design (#5543)

init
parent 85f4cec8
import { Trans } from '@lingui/macro' import { Trans } from '@lingui/macro'
import { getChainInfo } from 'constants/chainInfo' import { getChainInfo } from 'constants/chainInfo'
import { SupportedChainId } from 'constants/chains' import { SupportedChainId } from 'constants/chains'
import { AlertCircle } from 'react-feather' import { AlertTriangle } from 'react-feather'
import styled, { useTheme } from 'styled-components/macro' import styled, { useTheme } from 'styled-components/macro'
import { ThemedText } from '../../theme' import { ThemedText } from '../../theme'
...@@ -18,16 +18,19 @@ export default function FailedNetworkSwitchPopup({ chainId }: { chainId: Support ...@@ -18,16 +18,19 @@ export default function FailedNetworkSwitchPopup({ chainId }: { chainId: Support
return ( return (
<RowNoFlex> <RowNoFlex>
<div style={{ paddingRight: 16 }}>
<AlertCircle color={theme.deprecated_red1} size={24} />
</div>
<AutoColumn gap="sm"> <AutoColumn gap="sm">
<ThemedText.DeprecatedBody fontWeight={500}> <RowNoFlex style={{ alignItems: 'center' }}>
<Trans> <div style={{ paddingRight: 13 }}>
Failed to switch networks from the Uniswap Interface. In order to use Uniswap on {chainInfo.label}, you must <AlertTriangle color={theme.accentWarning} size={24} display="flex" />
change the network in your wallet. </div>
</Trans> <ThemedText.SubHeader>
</ThemedText.DeprecatedBody> <Trans>Failed to switch networks</Trans>
</ThemedText.SubHeader>
</RowNoFlex>
<ThemedText.BodySmall>
<Trans>To use Uniswap on {chainInfo.label}, switch the network in your wallet’s settings.</Trans>
</ThemedText.BodySmall>
</AutoColumn> </AutoColumn>
</RowNoFlex> </RowNoFlex>
) )
......
...@@ -10,8 +10,8 @@ import FailedNetworkSwitchPopup from './FailedNetworkSwitchPopup' ...@@ -10,8 +10,8 @@ import FailedNetworkSwitchPopup from './FailedNetworkSwitchPopup'
const StyledClose = styled(X)` const StyledClose = styled(X)`
position: absolute; position: absolute;
right: 10px; right: 20px;
top: 10px; top: 20px;
:hover { :hover {
cursor: pointer; cursor: pointer;
...@@ -83,7 +83,7 @@ export default function PopupItem({ ...@@ -83,7 +83,7 @@ export default function PopupItem({
return popupContent ? ( return popupContent ? (
<Popup> <Popup>
<StyledClose color={theme.deprecated_text2} onClick={removeThisPopup} /> <StyledClose color={theme.textSecondary} onClick={removeThisPopup} />
{popupContent} {popupContent}
{removeAfterMs !== null ? <AnimatedFader style={faderStyle} /> : null} {removeAfterMs !== null ? <AnimatedFader style={faderStyle} /> : null}
</Popup> </Popup>
......
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