on master help sign in
ux: add Download Keys button to Urbit OS index
91f4a7atomholford
src/views/UrbitOS/Home.tsx+17−2
@@ -14,6 +14,8 @@ import NetworkingKeys from 'components/NetworkingKeys';
14import { useLocalRouter } from 'lib/LocalRouter';
14import { useLocalRouter } from 'lib/LocalRouter';
15import { PointDetails } from 'types/pointDetailsType';
15import { PointDetails } from 'types/pointDetailsType';
16import AlertBox from 'components/AlertBox';
16import AlertBox from 'components/AlertBox';
17+import DownloadKeyfileButton from 'components/DownloadKeyfileButton';
18+import useKeyfileGenerator from 'lib/useKeyfileGenerator';
17
19
18export default function UrbitOSHome({ manualNetworkSeed }) {
20export default function UrbitOSHome({ manualNetworkSeed }) {
19 const { pointCursor } = usePointCursor();
21 const { pointCursor } = usePointCursor();
@@ -44,6 +46,9 @@ export default function UrbitOSHome({ manualNetworkSeed }) {
44 push,
46 push,
45 names,
47 names,
46 ]);
48 ]);
49+
50+ const { bind: keyBind } = useKeyfileGenerator();
51+
47 return (
52 return (
48 <>
53 <>
49 <Grid>
54 <Grid>
@@ -64,7 +69,17 @@ export default function UrbitOSHome({ manualNetworkSeed }) {
64 </Grid.Item>
69 </Grid.Item>
65 </>
70 </>
66 )}
71 )}
67−
72+ {hasSetNetworkingKeys && (
73+ <>
74+ <Grid.Divider />
75+ <Grid.Item
76+ full
77+ detail="A keyfile is used to boot your Urbit OS"
78+ as={DownloadKeyfileButton}
79+ {...keyBind}
80+ />
81+ </>
82+ )}
68 <Grid.Divider />
83 <Grid.Divider />
69 <Grid.Item full as={ForwardButton} onClick={goNetworkingKeys}>
84 <Grid.Item full as={ForwardButton} onClick={goNetworkingKeys}>
70 {networkKeysAction} Networking Keys
85 {networkKeysAction} Networking Keys
@@ -75,7 +90,7 @@ export default function UrbitOSHome({ manualNetworkSeed }) {
75 <Grid.Item
90 <Grid.Item
76 full
91 full
77 as={ForwardButton}
92 as={ForwardButton}
78− accessory={showKeys ? '▼' : '▲'}
93+ accessory={showKeys ? '▲' : '▼'}
79 onClick={toggleShowKeys}>
94 onClick={toggleShowKeys}>
80 View Networking Keys
95 View Networking Keys
81 </Grid.Item>
96 </Grid.Item>