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