1import React, { useCallback } from 'react';
2import { Just } from 'folktale/maybe';
3import { Grid } from 'indigo-react';
4import { azimuth } from 'azimuth-js';
6import { usePointCursor } from 'store/pointCursor';
7import { useWallet } from 'store/wallet';
9import View from 'components/View';
10import Greeting from 'components/Greeting';
11import Passport from 'components/Passport';
12import { ForwardButton, BootUrbitOSButton } from 'components/Buttons';
13import CopyButton from 'components/CopyButton';
14import { matchBlinky } from 'components/Blinky';
15import DownloadSigilButton from 'components/DownloadSigilButton';
17import * as need from 'lib/need';
18import useInvites from 'lib/useInvites';
19import { useSyncOwnedPoints } from 'lib/useSyncPoints';
20import useCurrentPermissions from 'lib/useCurrentPermissions';
21import { useLocalRouter } from 'lib/LocalRouter';
22import useKeyfileGenerator from 'lib/useKeyfileGenerator';
24export default function Point() {
25 const { pop, push, names } = useLocalRouter();
26 const { pointCursor } = usePointCursor();
28 const { wallet } = useWallet();
29 const point = need.point(pointCursor);
31 const { code, notice } = useKeyfileGenerator();
38 } = useCurrentPermissions();
40 // fetch the invites for the current cursor
41 const { availableInvites } = useInvites(point);
43 const goAdmin = useCallback(() => push(names.ADMIN), [push, names]);
45 const goInvite = useCallback(() => push(names.INVITE), [push, names]);
47 const goPartiesSetPoolSize = useCallback(
48 () => push(names.PARTY_SET_POOL_SIZE),
52 const goIssuePoint = useCallback(() => push(names.ISSUE_CHILD), [
57 const inviteButton = (() => {
58 switch (azimuth.getPointSize(point)) {
59 case azimuth.PointSize.Planet:
60 const availableInvitesText = matchBlinky(availableInvites);
66 disabled={!isActiveOwner}
68 Invite <sup>{availableInvitesText}</sup>
74 case azimuth.PointSize.Star:
80 disabled={!isActiveOwner}
81 onClick={goPartiesSetPoolSize}>
93 // sync the current cursor
94 useSyncOwnedPoints([point]);
96 const address = need.addressFromWallet(wallet);
99 <View pop={pop} inset>
100 <Greeting point={point} />
103 address={Just(address)}
104 animationMode={'slide'}
106 <Grid className="pt2">
111 disabled={!canManage}
123 onClick={goIssuePoint}>
129 <Grid.Item full as={BootUrbitOSButton} />
134 accessory={code && <CopyButton text={code} />}
135 detail={code || notice}
137 detailClassName="mono">
141 <Grid.Item full as={DownloadSigilButton} point={point} />
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