on c19b2a8 help sign in
bridge/src/components/Greeting.js
80 lines 2.4 kB history raw
1import React, { useCallback } from 'react';
2import cn from 'classnames';
3import ob from 'urbit-ob';
4import { Grid, Text, LinkButton } from 'indigo-react';
6import { useLocalRouter } from 'lib/LocalRouter';
8import useWasGreeted from 'lib/useWasGreeted';
9import useCurrentPermissions from 'lib/useCurrentPermissions';
11const TEXT_STYLE = 'f5';
13export default function ActivateDisclaimer({ point }) {
14 const { push, names } = useLocalRouter();
16 const [wasGreeted, setWasGreeted] = useWasGreeted();
17 const { isActiveOwner } = useCurrentPermissions();
19 const pointName = ob.patp(point);
21 const dismiss = useCallback(async () => {
22 setWasGreeted(true);
23 }, [setWasGreeted]);
25 const goInvite = useCallback(() => push(names.INVITE), [push, names]);
27 return (
28 !wasGreeted && (
29 <Grid gap={4} className="mb10">
30 <Grid.Item full>
31 <Text className={cn(TEXT_STYLE, 'block mb4')}>
32 Welcome <code>{pointName}</code>,
33 </Text>
35 <Text className={cn(TEXT_STYLE, 'block mb2')}>
36 As of this moment, you own a piece of Urbit. No one can take it from
37 you, and you can keep it for the rest of your life.
38 </Text>
39 <Text className={cn(TEXT_STYLE, 'block mb2')}>
40 Keep your Master Ticket safe. No one can recover it for you. But it
41 can get you back into Urbit at any time.
42 </Text>
43 <Text className={cn(TEXT_STYLE, 'block mb2')}>
44 Right now you can:
45 </Text>
46 </Grid.Item>
48 {isActiveOwner && (
49 <Grid.Item
50 full
51 as={LinkButton}
52 onClick={goInvite}
53 className={'yellow4'}>
54 <Text className={cn(TEXT_STYLE, 'block mb2')}>
55 Invite your friends
56 </Text>
57 </Grid.Item>
58 )}
60 <Grid.Item
61 full
62 as={LinkButton}
63 href="https://urbit.org/docs/getting-started/">
64 <Text className={cn(TEXT_STYLE, 'block mb2')}>
65 Boot Arvo, the Urbit OS
66 </Text>
67 </Grid.Item>
69 <Grid.Item full>
70 <Text className={cn(TEXT_STYLE, 'block mb4')}>
71 Welcome to Urbit. See you online.
72 </Text>
73 </Grid.Item>
74 <Grid.Item full as={LinkButton} onClick={dismiss}>
75 Close
76 </Grid.Item>
77 </Grid>
78 )
79 );