@@ -1,4 +1,5 @@
1import React, { useCallback } from 'react';
1import React, { useCallback } from 'react';
2+import { Just } from 'folktale/maybe';
2import * as need from 'lib/need';
3import * as need from 'lib/need';
3import { Grid } from 'indigo-react';
4import { Grid } from 'indigo-react';
@@ -13,10 +14,12 @@ import useInvites from 'lib/useInvites';
13import { ROUTE_NAMES } from 'lib/routeNames';
14import { ROUTE_NAMES } from 'lib/routeNames';
15import { useHistory } from 'store/history';
16import { useHistory } from 'store/history';
17+import { useWallet } from 'store/wallet';
16import FooterButton from 'components/FooterButton';
18import FooterButton from 'components/FooterButton';
18export default function Admin() {
20export default function Admin() {
19 const history = useHistory();
21 const history = useHistory();
22+ const { urbitWallet } = useWallet();
20 const { pointCursor } = usePointCursor();
23 const { pointCursor } = usePointCursor();
21 // const { pointCache } = usePointCache();
24 // const { pointCache } = usePointCache();
@@ -25,25 +28,34 @@ export default function Admin() {
25 // fetch the invites for the current cursor
28 // fetch the invites for the current cursor
26 const { availableInvites } = useInvites(point);
29 const { availableInvites } = useInvites(point);
31+ const goRedownload = useCallback(() => history.push(ROUTE_NAMES.REDOWNLOAD), [
28 const goReticket = useCallback(() => history.push(ROUTE_NAMES.RETICKET), [
35 const goReticket = useCallback(() => history.push(ROUTE_NAMES.RETICKET), [
32 // const pointDetails = need.fromPointCache(pointCache, point);
39 // const pointDetails = need.fromPointCache(pointCache, point);
41+ const canDownloadPassport = Just.hasInstance(urbitWallet);
36 <Grid className="pt2">
45 <Grid className="pt2">
37 <Grid.Item full>
46 <Grid.Item full>
38− //TODO "Set Keys" when unset?
39− <ForwardButton detail="Configure public keys">
47+ <ForwardButton
40− Edit Keys
48+ disabled={!canDownloadPassport}
49+ onClick={goRedownload}
50+ detail="Re-download your paper wallet">
41 </ForwardButton>
52 </ForwardButton>
42 </Grid.Item>
53 </Grid.Item>
43 <Grid.Divider />
54 <Grid.Divider />
44 <Grid.Item full>
55 <Grid.Item full>
45− //TODO disable if not logged in as owner
58+ detail="//TODO disable if not logged in as owner">
46− <ForwardButton detail="Get a new master ticket" onClick={goReticket}>
48 </ForwardButton>
60 </ForwardButton>
49 </Grid.Item>
61 </Grid.Item>