-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modding FailedNetworkSwitchPopup notification
- Loading branch information
Leandro
committed
Mar 11, 2022
1 parent
f2d0c3e
commit 200a692
Showing
2 changed files
with
36 additions
and
1 deletion.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
src/custom/components/Popups/FailedNetworkSwitchPopupMod.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { Trans } from '@lingui/macro' | ||
import { CHAIN_INFO } from 'constants/chainInfo' | ||
import { SupportedChainId } from 'constants/chains' | ||
import { useContext } from 'react' | ||
import { AlertCircle } from 'react-feather' | ||
import styled, { ThemeContext } from 'styled-components/macro' | ||
|
||
import { ThemedText } from 'theme' | ||
import { AutoColumn } from 'components/Column' | ||
import { AutoRow } from 'components/Row' | ||
|
||
const RowNoFlex = styled(AutoRow)` | ||
flex-wrap: nowrap; | ||
` | ||
|
||
export default function FailedNetworkSwitchPopup({ chainId }: { chainId: SupportedChainId }) { | ||
const chainInfo = CHAIN_INFO[chainId] | ||
const theme = useContext(ThemeContext) | ||
|
||
return ( | ||
<RowNoFlex> | ||
<div style={{ paddingRight: 16 }}> | ||
<AlertCircle color={theme.red1} size={24} /> | ||
</div> | ||
<AutoColumn gap="8px"> | ||
<ThemedText.Body fontWeight={500}> | ||
<Trans> | ||
Failed to switch networks from the CowSwap Interface. In order to use CowSwap on {chainInfo.label}, you must | ||
change the network in your wallet. | ||
</Trans> | ||
</ThemedText.Body> | ||
</AutoColumn> | ||
</RowNoFlex> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters