1import React, { useCallback, useState } from 'react';
2import { Just, Nothing } from 'folktale/maybe';
3import * as need from 'lib/need';
5import { usePointCursor } from 'store/pointCursor';
7import { DownloadButton, RestartButton } from 'components/Buttons';
8import PaperRenderer from 'components/PaperRenderer';
10import { downloadWallet } from 'lib/invite';
12import { useWallet } from 'store/wallet';
13import { Grid, P } from 'indigo-react';
14import ViewHeader from 'components/ViewHeader';
15import { useLocalRouter } from 'lib/LocalRouter';
16import MiniBackButton from 'components/MiniBackButton';
18export default function AdminRedownload() {
19 const { urbitWallet } = useWallet();
20 const { pointCursor } = usePointCursor();
21 const { pop } = useLocalRouter();
23 const _urbitWallet = need.wallet(urbitWallet);
24 const point = need.point(pointCursor);
26 const [paper, setPaper] = useState(Nothing());
27 const [downloaded, setDownloaded] = useState(false);
29 const doDownload = useCallback(() => {
30 downloadWallet(paper.value);
32 }, [paper, setDownloaded]);
34 const goBack = useCallback(() => pop(), [pop]);
39 <Grid.Item full as={MiniBackButton} onClick={() => pop()} />
40 <Grid.Item full as={ViewHeader}>
43 <Grid.Item full as={P}>
44 After you’ve downloaded your passport, back up the ticket manually or
45 store on a trusted device.
48 <Grid.Item full as={RestartButton} solid onClick={goBack}>
56 disabled={Nothing.hasInstance(paper)}
59 Nothing: () => 'Printing and folding...',
60 Just: _ => 'Download paper wallet',
69 setPaper(Just(paper));
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