Skip to content

Commit

Permalink
Modding FailedNetworkSwitchPopup notification
Browse files Browse the repository at this point in the history
  • Loading branch information
Leandro committed Mar 11, 2022
1 parent f2d0c3e commit 200a692
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
35 changes: 35 additions & 0 deletions src/custom/components/Popups/FailedNetworkSwitchPopupMod.tsx
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>
)
}
2 changes: 1 addition & 1 deletion src/custom/components/Popups/PopupItemMod.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import styled, { ThemeContext } from 'styled-components/macro'

import { useRemovePopup } from 'state/application/hooks'
import { PopupContent } from 'state/application/reducer'
import FailedNetworkSwitchPopup from 'components/Popups/FailedNetworkSwitchPopup'
import FailedNetworkSwitchPopup from './FailedNetworkSwitchPopupMod'
import TransactionPopup from './TransactionPopupMod'

// MOD imports
Expand Down

0 comments on commit 200a692

Please sign in to comment.