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 PaperBuilder from 'components/PaperBuilder';
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';
17export default function AdminRedownload() {
18 const { urbitWallet } = useWallet();
19 const { pointCursor } = usePointCursor();
20 const { pop } = useLocalRouter();
22 const _urbitWallet = need.wallet(urbitWallet);
23 const point = need.point(pointCursor);
25 const [paper, setPaper] = useState(Nothing());
26 const [downloaded, setDownloaded] = useState(false);
28 const doDownload = useCallback(() => {
29 downloadWallet(paper.value);
31 }, [paper, setDownloaded]);
33 const goBack = useCallback(() => pop(), [pop]);
38 <Grid.Item full as={ViewHeader}>
41 <Grid.Item full as={P}>
42 After you’ve downloaded your passport, back up the ticket manually or
43 store on a trusted device.
46 <Grid.Item full as={RestartButton} solid onClick={goBack}>
54 disabled={Nothing.hasInstance(paper)}
57 Nothing: () => 'Printing and folding...',
58 Just: _ => 'Download paper wallet',
65 wallets={[_urbitWallet]}
67 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