Skip to content

Commit

Permalink
bridge_ui: Disable transfers from oasis and display network upgrade m…
Browse files Browse the repository at this point in the history
  • Loading branch information
kev1n-peters authored Mar 7, 2022
1 parent d1da117 commit f448375
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 3 deletions.
10 changes: 8 additions & 2 deletions bridge_ui/src/components/NFT/Source.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import { CHAIN_ID_SOLANA, isEVMChain } from "@certusone/wormhole-sdk";
import {
CHAIN_ID_OASIS,
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";
Expand All @@ -19,6 +23,7 @@ import ButtonWithLoader from "../ButtonWithLoader";
import ChainSelect from "../ChainSelect";
import KeyAndBalance from "../KeyAndBalance";
import LowBalanceWarning from "../LowBalanceWarning";
import OasisNetworkUpgradeWarning from "../OasisNetworkUpgradeWarning";
import SolanaTPSWarning from "../SolanaTPSWarning";
import StepDescription from "../StepDescription";
import { TokenSelector } from "../TokenSelectors/SourceTokenSelector";
Expand Down Expand Up @@ -92,9 +97,10 @@ function Source() {
</div>
) : null}
<LowBalanceWarning chainId={sourceChain} />
{sourceChain === CHAIN_ID_OASIS && <OasisNetworkUpgradeWarning />}
{sourceChain === CHAIN_ID_SOLANA && <SolanaTPSWarning />}
<ButtonWithLoader
disabled={!isSourceComplete}
disabled={!isSourceComplete || sourceChain === CHAIN_ID_OASIS}
onClick={handleNextClick}
showLoader={false}
error={statusMessage || error}
Expand Down
21 changes: 21 additions & 0 deletions bridge_ui/src/components/OasisNetworkUpgradeWarning.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { makeStyles } 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 OasisNetworkUpgradeWarning() {
const classes = useStyles();

return (
<Alert variant="outlined" severity="warning" className={classes.alert}>
Transfers from Oasis to other chains are currently unavailable due to a
network software upgrade. Transfers from other chains to Oasis are
unaffected.
</Alert>
);
}
5 changes: 4 additions & 1 deletion bridge_ui/src/components/Transfer/Source.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {
CHAIN_ID_BSC,
CHAIN_ID_ETH,
CHAIN_ID_OASIS,
CHAIN_ID_SOLANA,
} from "@certusone/wormhole-sdk";
import { getAddress } from "@ethersproject/address";
Expand Down Expand Up @@ -39,6 +40,7 @@ import ChainSelectArrow from "../ChainSelectArrow";
import KeyAndBalance from "../KeyAndBalance";
import LowBalanceWarning from "../LowBalanceWarning";
import NumberTextField from "../NumberTextField";
import OasisNetworkUpgradeWarning from "../OasisNetworkUpgradeWarning";
import SolanaTPSWarning from "../SolanaTPSWarning";
import StepDescription from "../StepDescription";
import { TokenSelector } from "../TokenSelectors/SourceTokenSelector";
Expand Down Expand Up @@ -212,6 +214,7 @@ function Source() {
<>
<LowBalanceWarning chainId={sourceChain} />
{sourceChain === CHAIN_ID_SOLANA && <SolanaTPSWarning />}
{sourceChain === CHAIN_ID_OASIS && <OasisNetworkUpgradeWarning />}
<SourceAssetWarning
sourceChain={sourceChain}
sourceAsset={parsedTokenAccount?.mintKey}
Expand All @@ -233,7 +236,7 @@ function Source() {
/>
) : null}
<ButtonWithLoader
disabled={!isSourceComplete}
disabled={!isSourceComplete || sourceChain === CHAIN_ID_OASIS}
onClick={handleNextClick}
showLoader={false}
error={statusMessage || error}
Expand Down

0 comments on commit f448375

Please sign in to comment.