1import React, { useCallback } from 'react';
2import { Just } from 'folktale/maybe';
3import { Grid } from 'indigo-react';
4import * as need from 'lib/need';
6import View from 'components/View';
7import { ForwardButton } from 'components/Buttons';
9import { ROUTE_NAMES } from 'lib/routeNames';
10import { eqAddr } from 'lib/wallet';
12import { useHistory } from 'store/history';
13import { useWallet } from 'store/wallet';
14import { usePointCursor } from 'store/pointCursor';
15import { usePointCache } from 'store/pointCache';
16import FooterButton from 'components/FooterButton';
18export default function Admin() {
19 const history = useHistory();
20 const { urbitWallet, wallet } = useWallet();
21 const { pointCursor } = usePointCursor();
22 const { pointCache } = usePointCache();
24 const point = need.point(pointCursor);
25 const pointDetails = need.fromPointCache(pointCache, point);
26 const address = need.addressFromWallet(wallet);
28 const goRedownload = useCallback(() => history.push(ROUTE_NAMES.REDOWNLOAD), [
32 const goReticket = useCallback(() => history.push(ROUTE_NAMES.RETICKET), [
36 const goEditPerms = useCallback(() => history.push(ROUTE_NAMES.PERMISSIONS), [
40 const goTransfer = useCallback(() => history.push(ROUTE_NAMES.TRANSFER), [
44 const canDownloadPassport = Just.hasInstance(urbitWallet);
45 const isOwner = eqAddr(address, pointDetails.owner);
49 <Grid className="pt2">
53 disabled={!canDownloadPassport}
54 onClick={goRedownload}
55 detail="Re-download your paper wallet">
64 detail="Move to brand new wallet, re-setting all permissions">
71 detail="Management, networking keys, etc.">
77 detail="Transfer this identity to a new owner"
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