1import React, { useState, useCallback } from 'react';
2import { Nothing } from 'folktale/maybe';
3import { Grid, Text } from 'indigo-react';
5import { useLocalRouter } from 'lib/LocalRouter';
6import { downloadWallet } from 'lib/invite';
8import { ForwardButton, DownloadButton } from 'components/Buttons';
10export default function ReticketDownload({ newWallet }) {
11 const { push, names } = useLocalRouter();
13 const [downloaded, setDownloaded] = useState(false);
15 const download = () => {
16 downloadWallet(newWallet.value.paper);
20 const goVerify = useCallback(() => push(names.VERIFY), [push, names]);
23 <Grid className="mt4">
24 <Grid.Item full as={Text}>
25 Download the new passport, and keep it somewhere safe!
29 as={!downloaded ? DownloadButton : ForwardButton}
31 disabled={Nothing.hasInstance(newWallet)}
32 onClick={!downloaded ? download : goVerify}
35 {!downloaded ? 'Download Passport' : 'Continue'}
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