1import { useCallback, useMemo } from 'react';
3import View from 'components/View';
4import ActivateView from './ActivateView';
5import CodeExpired from './CodeExpired';
7import { useLocalRouter } from 'lib/LocalRouter';
8import useImpliedTicket from 'lib/useImpliedTicket';
9import useHasDisclaimed from 'lib/useHasDisclaimed';
10import useIsExpiredInvite from 'lib/useIsExpiredInvite';
12import { ReactComponent as PlaceholderSigil } from 'assets/blank-planet-sigil.svg';
13import { FadeablePointPresenter as PointPresenter } from './PointPresenter';
14import { Box } from '@tlon/indigo-react';
15import { FadeableActivateHeader as ActivateHeader } from './ActivateHeader';
16import { FadeableActivateCodeForm as ActivateCodeForm } from './ActivateCodeForm';
17import useFadeIn from './useFadeIn';
19export default function ActivateCode() {
20 const { names, push }: any = useLocalRouter();
21 const { impliedPatp, impliedTicket } = useImpliedTicket();
22 const [hasDisclaimed] = useHasDisclaimed();
24 const goToMasterKey = useCallback(() => {
26 push(names.DISCLAIMER, { next: names.MASTER_KEY });
28 push(names.MASTER_KEY);
30 }, [hasDisclaimed, names.DISCLAIMER, names.MASTER_KEY, push]);
35 const hasInitialValues = useMemo(
36 () => Boolean(impliedTicket && impliedPatp),
37 [impliedTicket, impliedPatp]
40 const { isExpired } = useIsExpiredInvite(impliedPatp, impliedTicket);
48 hideBack={hasInitialValues}
53 ? 'Welcome. This is your Urbit ID.'
58 footer={<ActivateCodeForm afterSubmit={goToMasterKey} />}>
59 <Box className="flex-col align-center justify-center w-full h-full">
63 className="mb2 sans gray5"
70 An Urbit ID is your unique identity that you use to
71 communicate on Urbit. You own it forever.
74 className="mb2 sans gray5"
81 To activate your Urbit ID, begin by claiming it via the link
86 <Box className="mb2 sans gray5" fontSize={14}>
87 Enter your planet activation code below.
91 <PointPresenter patp={impliedPatp} className="mb6 mt7" />
93 <PlaceholderSigil className="mv9" style={{ marginTop: 78 }} />
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list