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, BootArvoButton } from 'components/Buttons';
13import { matchBlinky } from 'components/Blinky';
14import DownloadSigilButton from 'components/DownloadSigilButton';
16import * as need from 'lib/need';
17import useInvites from 'lib/useInvites';
18import { useSyncOwnedPoints } from 'lib/useSyncPoints';
19import useCurrentPermissions from 'lib/useCurrentPermissions';
20import { useLocalRouter } from 'lib/LocalRouter';
22export default function Point() {
23 const { pop, push, names } = useLocalRouter();
24 const { pointCursor } = usePointCursor();
26 const { wallet } = useWallet();
27 const point = need.point(pointCursor);
34 } = useCurrentPermissions();
36 // fetch the invites for the current cursor
37 const { availableInvites } = useInvites(point);
39 const goAdmin = useCallback(() => push(names.ADMIN), [push, names]);
41 const goInvite = useCallback(() => push(names.INVITE), [push, names]);
43 const goPartiesSetPoolSize = useCallback(
44 () => push(names.PARTY_SET_POOL_SIZE),
48 const goIssuePoint = useCallback(() => push(names.ISSUE_CHILD), [
53 const inviteButton = (() => {
54 switch (azimuth.getPointSize(point)) {
55 case azimuth.PointSize.Planet:
56 const availableInvitesText = matchBlinky(availableInvites);
62 disabled={!isActiveOwner}
64 Invite <sup>{availableInvitesText}</sup>
70 case azimuth.PointSize.Star:
76 disabled={!isActiveOwner}
77 onClick={goPartiesSetPoolSize}>
89 // sync the current cursor
90 useSyncOwnedPoints([point]);
92 const address = need.addressFromWallet(wallet);
95 <View pop={pop} inset>
96 <Greeting point={point} />
99 address={Just(address)}
100 animationMode={'slide'}
102 <Grid className="pt2">
107 disabled={!canManage}
118 onClick={goIssuePoint}>
124 <Grid.Item full as={BootArvoButton} />
126 <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