-
Notifications
You must be signed in to change notification settings - Fork 82
Expand file tree
/
Copy pathHomeNetworkConnectView.tsx
More file actions
86 lines (80 loc) · 2.43 KB
/
Copy pathHomeNetworkConnectView.tsx
File metadata and controls
86 lines (80 loc) · 2.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
import React from "react";
import Typography from "@mui/material/Typography";
import Button from "@mui/material/Button";
import { WalletType } from "@chainsafe/chainbridge-ui-core";
import { BridgeConfig } from "../../chainbridgeConfig";
type HomeNetworkConnectViewProps = {
isReady: boolean | undefined;
classes: any;
setWalletType: (walletType: WalletType) => void;
walletConnecting: boolean;
setChangeNetworkOpen: React.Dispatch<React.SetStateAction<boolean>>;
homeConfig: BridgeConfig | undefined;
};
export default function HomeNetworkConnectView({
isReady,
classes,
walletConnecting,
homeConfig,
setWalletType,
setChangeNetworkOpen,
}: HomeNetworkConnectViewProps) {
return (
<div className={classes.walletArea}>
{!isReady ? (
<>
<Typography sx={{ mb: 2 }} component="p" variant="body1">
To convert a token that needs to be wrapped, please connect to the
network that the token exists natively for. For example, to convert
ETH into wrapped ETH (WETH), your wallet must be connected to an
Ethereum network.
</Typography>
<Button
fullWidth
variant="contained"
sx={{
backgroundColor: "#262626",
color: "#ffffff",
":hover": {
backgroundColor: "#262626",
opacity: 0.9,
},
}}
onClick={() => {
setWalletType("select");
}}
>
Connect
</Button>
</>
) : walletConnecting ? (
<section className={classes.connecting}>
<Typography component="p" variant="h5">
This app requires access to your wallet, <br />
please login and authorize access to continue.
</Typography>
</section>
) : (
<section className={classes.connected}>
<div>
<Typography variant="body1">Home network</Typography>
<Typography
className={classes.changeButton}
variant="body1"
onClick={() => setChangeNetworkOpen(true)}
>
Change
</Typography>
</div>
<Typography
component="h5"
variant="h5"
className={classes.networkName}
>
{homeConfig?.name}
</Typography>
</section>
)}
</div>
);
}