on 0f31fcb help sign in
bridge/src/components/DownloadKeyfileButton.js
47 lines 1.3 kB history raw
1import React from 'react';
2import { Flex, B } from 'indigo-react';
4import useKeyfileGenerator from 'lib/useKeyfileGenerator';
6import { DownloadButton } from 'components/Buttons';
8export default function DownloadKeyfileButton({
9 networkSeed,
10 className,
11 ...rest
12}) {
13 const { generating, available, downloaded, download } = useKeyfileGenerator(
14 networkSeed
15 );
17 const showHelp = !generating && !available;
19 return (
20 <DownloadButton
21 as="span"
22 className={className}
23 disabled={downloaded || !available}
24 disabledDetail={
25 // TODO: make this a toggle-able 'help' or something — too much space
26 showHelp && (
27 <Flex col>
28 <Flex.Item as={B} className="wrap ws-normal">
29 · You are using nondeterministic networking keys. To download your
30 Arvo keyfile, either:
31 </Flex.Item>
32 <Flex.Item as={B} className="wrap ws-normal">
33 a) Reset your networking keys, or
34 </Flex.Item>
35 <Flex.Item as={B} className="wrap ws-normal">
36 b) Reticket to get deterministic networking keys.
37 </Flex.Item>
38 </Flex>
39 )
40 }
41 loading={generating}
42 onClick={download}
43 {...rest}>
44 Download Arvo Keyfile
45 </DownloadButton>
46 );