bridge_ui: enable polygon transfers

This commit is contained in:
Kevin Peters 2022-03-15 00:22:24 +00:00 committed by Evan Gray
parent d233436168
commit 21e2a710a7
4 changed files with 4 additions and 49 deletions

View File

@ -1,8 +1,4 @@
import {
CHAIN_ID_POLYGON,
CHAIN_ID_SOLANA,
isEVMChain,
} from "@certusone/wormhole-sdk";
import { CHAIN_ID_SOLANA, isEVMChain } from "@certusone/wormhole-sdk";
import { Button, makeStyles } from "@material-ui/core";
import { VerifiedUser } from "@material-ui/icons";
import { Alert } from "@material-ui/lab";
@ -23,7 +19,6 @@ import ButtonWithLoader from "../ButtonWithLoader";
import ChainSelect from "../ChainSelect";
import KeyAndBalance from "../KeyAndBalance";
import LowBalanceWarning from "../LowBalanceWarning";
import PolygonNetworkDownWarning from "../PolygonNetworkDownWarning";
import SolanaTPSWarning from "../SolanaTPSWarning";
import StepDescription from "../StepDescription";
import { TokenSelector } from "../TokenSelectors/SourceTokenSelector";
@ -97,10 +92,9 @@ function Source() {
</div>
) : null}
<LowBalanceWarning chainId={sourceChain} />
{sourceChain === CHAIN_ID_POLYGON && <PolygonNetworkDownWarning />}
{sourceChain === CHAIN_ID_SOLANA && <SolanaTPSWarning />}
<ButtonWithLoader
disabled={!isSourceComplete || sourceChain === CHAIN_ID_POLYGON}
disabled={!isSourceComplete}
onClick={handleNextClick}
showLoader={false}
error={statusMessage || error}

View File

@ -1,5 +1,4 @@
import {
CHAIN_ID_POLYGON,
CHAIN_ID_SOLANA,
hexToNativeString,
hexToUint8Array,
@ -32,7 +31,6 @@ import ButtonWithLoader from "../ButtonWithLoader";
import ChainSelect from "../ChainSelect";
import KeyAndBalance from "../KeyAndBalance";
import LowBalanceWarning from "../LowBalanceWarning";
import PolygonNetworkDownWarning from "../PolygonNetworkDownWarning";
import SolanaTPSWarning from "../SolanaTPSWarning";
import StepDescription from "../StepDescription";
@ -140,9 +138,8 @@ function Target() {
</Alert>
<LowBalanceWarning chainId={targetChain} />
{targetChain === CHAIN_ID_SOLANA && <SolanaTPSWarning />}
{targetChain === CHAIN_ID_POLYGON && <PolygonNetworkDownWarning />}
<ButtonWithLoader
disabled={!isTargetComplete || targetChain === CHAIN_ID_POLYGON} //|| !associatedAccountExists}
disabled={!isTargetComplete} //|| !associatedAccountExists}
onClick={handleNextClick}
showLoader={false}
error={statusMessage || error}

View File

@ -1,30 +0,0 @@
import { Link, makeStyles, Typography } from "@material-ui/core";
import { Alert } from "@material-ui/lab";
const useStyles = makeStyles((theme) => ({
alert: {
marginTop: theme.spacing(1),
marginBottom: theme.spacing(1),
},
}));
export default function PolygonNetworkDownWarning() {
const classes = useStyles();
return (
<Alert variant="outlined" severity="warning" className={classes.alert}>
Polygon is currently experiencing partial downtime.
As a precautionary measure, Wormhole Network and Portal have paused Polygon
support until the network has been fully restored.
<Typography component="div">
<Link
href="https://twitter.com/0xPolygonDevs"
target="_blank"
rel="noopener noreferrer"
>
Follow @0xPolygonDevs for updates
</Link>
</Typography>
</Alert>
);
}

View File

@ -1,7 +1,6 @@
import {
CHAIN_ID_BSC,
CHAIN_ID_ETH,
CHAIN_ID_POLYGON,
CHAIN_ID_SOLANA,
} from "@certusone/wormhole-sdk";
import { getAddress } from "@ethersproject/address";
@ -40,7 +39,6 @@ import ChainSelectArrow from "../ChainSelectArrow";
import KeyAndBalance from "../KeyAndBalance";
import LowBalanceWarning from "../LowBalanceWarning";
import NumberTextField from "../NumberTextField";
import PolygonNetworkDownWarning from "../PolygonNetworkDownWarning";
import SolanaTPSWarning from "../SolanaTPSWarning";
import StepDescription from "../StepDescription";
import { TokenSelector } from "../TokenSelectors/SourceTokenSelector";
@ -142,9 +140,6 @@ function Source() {
dispatch(incrementStep());
}, [dispatch]);
const isPolygonTransfer =
sourceChain === CHAIN_ID_POLYGON || targetChain === CHAIN_ID_POLYGON;
return (
<>
<StepDescription>
@ -220,7 +215,6 @@ function Source() {
<>
<LowBalanceWarning chainId={sourceChain} />
{sourceChain === CHAIN_ID_SOLANA && <SolanaTPSWarning />}
{isPolygonTransfer && <PolygonNetworkDownWarning />}
<SourceAssetWarning
sourceChain={sourceChain}
sourceAsset={parsedTokenAccount?.mintKey}
@ -242,7 +236,7 @@ function Source() {
/>
) : null}
<ButtonWithLoader
disabled={!isSourceComplete || isPolygonTransfer}
disabled={!isSourceComplete}
onClick={handleNextClick}
showLoader={false}
error={statusMessage || error}