bridge_ui: Click arrow to swap source and target chains

This commit is contained in:
Kevin Peters 2021-12-21 23:24:57 +00:00 committed by Evan Gray
parent f90ed66ca0
commit 21c3f143db
1 changed files with 10 additions and 2 deletions

View File

@ -4,7 +4,7 @@ import {
CHAIN_ID_SOLANA,
} from "@certusone/wormhole-sdk";
import { getAddress } from "@ethersproject/address";
import { Button, makeStyles, Typography } from "@material-ui/core";
import { Button, IconButton, makeStyles, Typography } from "@material-ui/core";
import { ArrowForward, VerifiedUser } from "@material-ui/icons";
import { useCallback, useMemo } from "react";
import { useDispatch, useSelector } from "react-redux";
@ -136,6 +136,7 @@ function Source() {
const handleNextClick = useCallback(() => {
dispatch(incrementStep());
}, [dispatch]);
return (
<>
<StepDescription>
@ -169,7 +170,14 @@ function Source() {
/>
</div>
<div className={classes.chainSelectArrow}>
<ArrowForward style={{ margin: "0px 8px" }} />
<IconButton
onClick={() => {
dispatch(setSourceChain(targetChain));
}}
disabled={shouldLockFields}
>
<ArrowForward />
</IconButton>
</div>
<div className={classes.chainSelectContainer}>
<Typography variant="caption">Target</Typography>