1import React from 'react';
2import { Grid } from 'indigo-react';
4import { useHistory } from 'store/history';
6import useCurrentPointName from 'lib/useCurrentPointName';
7import useRouter from 'lib/useRouter';
8import { LocalRouterProvider } from 'lib/LocalRouter';
10import View from 'components/View';
11import Crumbs from 'components/Crumbs';
12import NavHeader from 'components/NavHeader';
14import UrbitIDHome from './UrbitID/Home';
15import SigilGenerator from './UrbitID/SigilGenerator';
16import DownloadKeys from './UrbitID/DownloadKeys';
17import SetProxy from './UrbitID/SetProxy';
18import ResetKeys from './UrbitID/ResetKeys';
19import Transfer from './UrbitID/Transfer';
23 SIGIL_GENERATOR: 'SIGIL_GENERATOR',
24 DOWNLOAD_KEYS: 'DOWNLOAD_KEYS',
25 SET_PROXY: 'SET_PROXY',
26 RESET_KEYS: 'RESET_KEYS',
31 [NAMES.HOME]: UrbitIDHome,
32 [NAMES.SIGIL_GENERATOR]: SigilGenerator,
33 [NAMES.DOWNLOAD_KEYS]: DownloadKeys,
34 [NAMES.RESET_KEYS]: ResetKeys,
35 [NAMES.SET_PROXY]: SetProxy,
36 [NAMES.TRANSFER]: Transfer,
39const humanizeName = name => {
41 case NAMES.SIGIL_GENERATOR:
43 case NAMES.DOWNLOAD_KEYS:
44 return 'Download Keys';
47 case NAMES.RESET_KEYS:
56export default function UrbitID() {
57 const history = useHistory();
58 const name = useCurrentPointName();
60 const { Route, ...router } = useRouter({
63 initialRoutes: [{ key: NAMES.HOME }],
66 const last = router.peek().key;
67 const homeAction = last === NAMES.HOME ? undefined : () => history.pop();
68 const lastCrumb = homeAction ? [{ text: humanizeName(last) }] : [];
73 router.peek().key === NAMES.HOME ? history.pop() : router.pop()
79 { text: name, action: () => history.pop() },
80 { text: 'Urbit ID', action: homeAction },
86 <LocalRouterProvider value={router}>
87 <Grid className="mb4"></Grid>
89 </LocalRouterProvider>
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