-
Notifications
You must be signed in to change notification settings - Fork 147
Expand file tree
/
Copy pathConnectQR.tsx
More file actions
69 lines (62 loc) · 1.63 KB
/
Copy pathConnectQR.tsx
File metadata and controls
69 lines (62 loc) · 1.63 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
import { Box } from "@mui/material";
import { QRCodeSVG } from "qrcode.react";
import Fade from "@mui/material/Fade";
import CircularProgress from "@mui/material/CircularProgress";
import { styled } from "@mui/system";
import TonhubQr from "assets/icons/tonhub-qr.png";
import TonkeeperQr from "assets/icons/tonkeeper-qr.png";
import Header from "./Header";
import { Providers } from "lib/env-profiles";
const StyledContainer = styled(Box)({
display: "flex",
flexDirection: "column",
alignItems: "center",
});
const StyledQrBox = styled(Box)({
width: 260,
height: 260,
display: "flex",
alignItems: "center",
justifyContent: "center",
});
interface Props {
onClose: () => void;
link: string | null;
open: boolean;
walletName: string;
}
function QR({ onClose, link, open, walletName }: Props) {
if (!open) {
return null;
}
return (
<Fade in>
<StyledContainer>
<Header title={`Connect to ${walletName}`} onClose={onClose} />
<StyledQrBox>
{link ? (
<span>
<QRCodeSVG
value={link}
size={260}
bgColor={"#ffffff"}
fgColor={"#002457"}
level={"L"}
includeMargin={false}
imageSettings={{
src: walletName === Providers.TON_HUB ? TonhubQr : TonkeeperQr,
height: 50,
width: 50,
excavate: true,
}}
/>
</span>
) : (
<CircularProgress />
)}
</StyledQrBox>
</StyledContainer>
</Fade>
);
}
export default QR;