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