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';
8import View from 'components/View';
9import Greeting from 'components/Greeting';
10import Passport from 'components/Passport';
11import { ForwardButton, BootArvoButton } from 'components/Buttons';
12import { matchBlinky } from 'components/Blinky';
13import SigilDownloader from 'components/SigilDownloader';
15import * as need from 'lib/need';
16import useInvites from 'lib/useInvites';
17import { useSyncOwnedPoints } from 'lib/useSyncPoints';
18import useCurrentPermissions from 'lib/useCurrentPermissions';
19import { useLocalRouter } from 'lib/LocalRouter';
21export default function Point() {
22 const { pop, push, names } = useLocalRouter();
23 const { pointCursor } = usePointCursor();
25 const point = need.point(pointCursor);
32 } = useCurrentPermissions();
34 // fetch the invites for the current cursor
35 const { availableInvites } = useInvites(point);
37 const goAdmin = useCallback(() => push(names.ADMIN), [push, names]);
39 const goInvite = useCallback(() => push(names.INVITE), [push, names]);
41 const goPartiesSetPoolSize = useCallback(
42 () => push(names.PARTY_SET_POOL_SIZE),
46 const goIssuePoint = useCallback(() => push(names.ISSUE_CHILD), [
51 const inviteButton = (() => {
52 switch (azimuth.getPointSize(point)) {
53 case azimuth.PointSize.Planet:
54 const availableInvitesText = matchBlinky(availableInvites);
60 disabled={!isActiveOwner}
62 Invite <sup>{availableInvitesText}</sup>
68 case azimuth.PointSize.Star:
74 disabled={!isActiveOwner}
75 onClick={goPartiesSetPoolSize}>
87 // sync the current cursor
88 useSyncOwnedPoints([point]);
91 <View pop={pop} inset>
92 <Greeting point={point} />
93 <SigilDownloader point={point}>
94 <Passport point={Just(point)} />
96 <Grid className="pt2">
101 disabled={!canManage}
112 onClick={goIssuePoint}>
118 <Grid.Item full as={BootArvoButton} />
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