on 64aee13 help sign in
bridge/src/views/Disclaimer.js
105 lines 3.8 kB history raw
1import React, { useCallback, useMemo } from 'react';
2import cn from 'classnames';
3import { Grid, H3, B, Text, CheckboxInput } from 'indigo-react';
5import { useHistory } from 'store/history';
6import useHasDisclaimed from 'lib/useHasDisclaimed';
8import View from 'components/View';
9import WarningBox from 'components/WarningBox';
10import BridgeForm from 'form/BridgeForm';
11import SubmitButton from 'form/SubmitButton';
12import { composeValidator, buildCheckboxValidator } from 'form/validators';
14const TEXT_STYLE = 'f5';
16export default function ActivateDisclaimer() {
17 const { pop } = useHistory();
18 const [, setHasDisclaimed] = useHasDisclaimed();
20 const validate = useMemo(
21 () => composeValidator({ checkbox: buildCheckboxValidator(true) }),
22 []
23 );
25 const initialValues = useMemo(() => ({ checkbox: false }), []);
27 const goBack = useCallback(async () => {
28 setHasDisclaimed(true);
29 pop();
30 }, [pop, setHasDisclaimed]);
32 return (
33 <View>
34 <Grid gap={2} className="mt8 mb10">
35 <Grid.Item as={H3} full>
36 Disclaimer
37 </Grid.Item>
38 <Grid.Item full>
39 <Text className={cn(TEXT_STYLE, 'block mb4')}>
40 Welcome to Bridge. Please read this information. Your assets could
41 be stolen if you do not pay attention to these warnings.
42 </Text>
44 <Text className={cn(TEXT_STYLE, 'block mb4')}>
45 <B>You own and control your assets. We do not.</B> If you send your
46 assets to another address, we can’t get them back for you.
47 </Text>
49 <B className={TEXT_STYLE}>Please understand that nobody can:</B>
50 <Text className={cn(TEXT_STYLE, 'block mb4')}>
51 1. Access your assets for you <br />
52 2. Recover, reset, or modify ANY of your information <br />
53 3. Reverse, cancel, or refund transactions <br />
54 4. Hold, back-up, or access your keys
55 </Text>
57 <B className={TEXT_STYLE}>
58 You’re responsible for keeping your information safe. This includes:
59 </B>
60 <Text className={cn(TEXT_STYLE, 'block mb4')}>
61 1. Private Keys/Mnemonic Phrases and passwords <br />
62 2. JSON files <br />
63 3. Hardware wallet PINs; <br />
64 4. Downloading this software from a reliable site, and ensuring it
65 has not been tampered with. [add something about using the checksum
66 here]
67 </Text>
69 <B className={TEXT_STYLE}>To be clear</B>
70 <Text className={cn(TEXT_STYLE, 'block')}>
71 This software is provided “as is” without warranties of any kind and
72 our liability to you in connection with the same is limited;
73 </Text>
74 <Text className={cn(TEXT_STYLE, 'block')}>
75 We have no liability for any security problems or incidents that you
76 may experience, including any loss or theft of your keys or any
77 problems that may arise in connection with your wallet.
78 </Text>
79 </Grid.Item>
80 <Grid.Item full as={WarningBox}>
81 Warning: Nobody but you can restore or reset your Master Ticket
82 </Grid.Item>
83 <BridgeForm
84 validate={validate}
85 afterSubmit={goBack}
86 initialValues={initialValues}>
87 {({ handleSubmit }) => (
88 <>
89 <Grid.Item
90 full
91 as={CheckboxInput}
92 name="checkbox"
93 label="I acknowledge and understand these rights"
94 />
96 <Grid.Item full as={SubmitButton} handleSubmit={handleSubmit}>
97 Continue
98 </Grid.Item>
99 </>
100 )}
101 </BridgeForm>
102 </Grid>
103 </View>
104 );