-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRecoveryKeyDialog.tsx
98 lines (92 loc) · 2.24 KB
/
RecoveryKeyDialog.tsx
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
87
88
89
90
91
92
93
94
95
96
97
98
import { useState } from "react";
import {
AdvancedDialog,
theme,
Typography,
MuiCard,
Button
} from "@gliff-ai/style";
import { useNavigate } from "react-router-dom";
interface Props {
recoveryKey: string[] | null;
}
export const RecoveryKeyDialog = ({ recoveryKey }: Props): JSX.Element => {
const [forceClose, setForceClose] = useState(false);
const navigate = useNavigate();
function onClose() {
navigate("/signin");
}
return (
<AdvancedDialog
open={!!recoveryKey && !forceClose}
onClose={() => onClose()}
maxWidth="md"
title="Recovery Key"
>
<MuiCard
sx={{
width: "100%",
height: "67px",
border: "4px solid white",
}}
>
<Typography
sx={{
textAlign: "center",
padding: "19px 0",
backgroundColor: "#fff",
}}
>
{recoveryKey?.join(" ")}
</Typography>
</MuiCard>
<Typography
sx={{
marginBottom: "44px",
marginTop: "13px",
color: theme.palette.text.primary,
fontSize: 21,
fontWeight: 700,
width: "100%",
textAlign: "center",
}}
>
This is YOUR randomly generated recovery key
</Typography>
<Typography
sx={{
marginBottom: "44px",
marginTop: "13px",
color: "#000",
fontSize: "21px",
textAlign: "center",
width: "100%",
"& em": {
fontWeight: "bold",
textTransform: "uppercase",
fontStyle: "normal",
},
}}
>
Please keep your recovery key stored in a safe place as this is the
<em> only</em> time you will be shown. We <em>do not</em> store your
recovery key, if you lose this we will be unable to recover your data
attached to the account.
<br />
<br />
<br />
<Button
onClick={() => {
setForceClose(true);
onClose();
}}
type="button"
color="primary"
variant="contained"
sx={{ textAlign: "center" }}
text="Ok"
/>
</Typography>
</AdvancedDialog>
);
};