1import React, { useCallback } from 'react';
2import { Just } from 'folktale/maybe';
3import { Grid } from 'indigo-react';
4import * as need from 'lib/need';
6import { ForwardButton, DownloadButton } from 'components/Buttons';
8import { useHistory } from 'store/history';
9import { useWallet } from 'store/wallet';
10import { usePointCursor } from 'store/pointCursor';
12import useKeyfileGenerator from 'lib/useKeyfileGenerator';
13import usePermissionsForPoint from 'lib/usePermissionsForPoint';
15import FooterButton from 'components/FooterButton';
16import ViewHeader from 'components/ViewHeader';
17import Blinky from 'components/Blinky';
18import { useLocalRouter } from 'lib/LocalRouter';
20export default function AdminHome() {
21 const history = useHistory();
22 const { push, names } = useLocalRouter();
23 const { urbitWallet, wallet } = useWallet();
24 const { pointCursor } = usePointCursor();
26 const point = need.point(pointCursor);
27 const address = need.addressFromWallet(wallet);
28 const { isOwner, canTransfer } = usePermissionsForPoint(address, point);
31 generating: generatingKeyfile,
32 available: keyfileAvailable,
33 generateAndDownload: generateAndDownloadKeyfile,
34 } = useKeyfileGenerator(point);
36 const goRedownload = useCallback(() => push(names.REDOWNLOAD), [push, names]);
37 const goReticket = useCallback(() => push(names.RETICKET), [push, names]);
38 const goEditPermissions = useCallback(() => push(names.EDIT_PERMISSIONS), [
42 const goTransfer = useCallback(() => history.push(history.names.TRANSFER), [
46 const canDownloadPassport = Just.hasInstance(urbitWallet);
51 <Grid.Item full as={ViewHeader}>
58 disabled={!canDownloadPassport}
59 onClick={goRedownload}
60 detail="Re-download your paper wallet">
67 disabled={!keyfileAvailable}
68 accessory={generatingKeyfile ? <Blinky /> : undefined}
69 onClick={generateAndDownloadKeyfile}
70 detail="Download your Arvo Keyfile">
79 detail="Move to brand new wallet, resetting all permissions">
86 onClick={goEditPermissions}
87 detail="Proxies, networking keys, etc.">
93 detail="Transfer this identity to a new owner"
94 disabled={!canTransfer}
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