on df0c310 help sign in
bridge/src/views/Disclaimer.jsx
144 lines 4.6 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 BridgeForm from 'form/BridgeForm';
10import SubmitButton from 'form/SubmitButton';
11import { composeValidator, buildCheckboxValidator } from 'form/validators';
13const textProps = {
14 fontFamily: 'Inter',
15 fontSize: '14px',
16 lineHeight: '20px',
17};
19export default function ActivateDisclaimer() {
20 const { pop, popAndPush, data } = useLocalRouter();
21 const [, setHasDisclaimed] = useHasDisclaimed();
23 const validate = useMemo(
24 () => composeValidator({ checkbox: buildCheckboxValidator(true) }),
25 []
26 );
28 const initialValues = useMemo(() => ({ checkbox: false }), []);
30 const goNext = useCallback(async () => {
31 setHasDisclaimed(true);
32 if (data.next) {
33 popAndPush(data.next);
34 } else {
35 pop();
36 }
37 }, [data, pop, popAndPush, setHasDisclaimed]);
39 return (
40 <View>
41 <Grid gap={2} className="mt8 mb10">
42 <Grid.Item full>
43 <Text
44 as="h3"
45 style={{ ...textProps, fontSize: '16px', fontWeight: 'bold' }}>
46 Disclaimer
47 </Text>
48 </Grid.Item>
49 <Grid.Item full>
50 <Text as="p" style={textProps}>
51 Welcome to Bridge. Please read this information. Your Urbit ID is
52 considered a digital asset. You must secure it. If you do not pay
53 attention to these warnings, your digital assets could be stolen or
54 compromised.
55 </Text>
57 <Text as="p" style={textProps}>
58 <strong>You own and control your assets. We do not.</strong> If you
59 send your assets to another address, we cannot get them back for
60 you.
61 </Text>
63 <Text as="p" style={textProps}>
64 Please understand that nobody can:
65 </Text>
67 <Text as={'ol'} style={{ paddingLeft: '1em' }}>
68 <Text as="li" style={textProps}>
69 Access your assets for you;
70 </Text>
71 <Text as="li" style={textProps}>
72 Recover, reset, or modify ANY of your information;
73 </Text>
74 <Text as="li" style={textProps}>
75 Reverse, cancel, or refund transactions;
76 </Text>
77 <Text as="li" style={textProps}>
78 Hold, back-up, or access your keys
79 </Text>
80 </Text>
82 <Text as="p" style={{ ...textProps, fontWeight: 'bold' }}>
83 You are responsible for keeping your information safe. This
84 includes:
85 </Text>
87 <Text as={'ol'} style={{ paddingLeft: '1em' }}>
88 <Text as="li" style={textProps}>
89 Private Keys/Mnemonic Phrases and passwords;
90 </Text>
91 <Text as="li" style={textProps}>
92 JSON files;{' '}
93 </Text>
94 <Text as="li" style={textProps}>
95 Hardware wallet PINs;{' '}
96 </Text>
97 <Text as="li" style={textProps}>
98 Downloading this software from a reliable site, and ensuring it
99 has not been tampered with
100 </Text>
101 </Text>
103 <Text as="p" style={{ ...textProps, fontWeight: 'bold' }}>
104 To be clear:
105 </Text>
107 <Text as="p" style={textProps}>
108 This software is provided “as is” without warranties of any kind and
109 our liability to you in connection with the same is limited;
110 </Text>
112 <Text as="p" style={textProps}>
113 We have no liability for any security problems or incidents that you
114 may experience, including any loss or theft of your keys or any
115 problems that may arise in connection with your wallet.
116 </Text>
117 </Grid.Item>
118 <BridgeForm
119 validate={validate}
120 afterSubmit={goNext}
121 initialValues={initialValues}>
122 {({ handleSubmit }) => (
123 <>
124 <Grid.Item
125 full
126 as={CheckboxInput}
127 name="checkbox"
128 label="I acknowledge and understand these rights"
129 />
131 <Grid.Item
132 center
133 full
134 as={SubmitButton}
135 handleSubmit={handleSubmit}>
136 Continue
137 </Grid.Item>
138 </>
139 )}
140 </BridgeForm>
141 </Grid>
142 </View>
143 );