1import React, { useCallback } from 'react';
2import { Just } from 'folktale/maybe';
3import * as need from 'lib/need';
4import { Grid } from 'indigo-react';
5import { azimuth } from 'azimuth-js';
7import { usePointCursor } from 'store/pointCursor';
8import { useHistory } from 'store/history';
10import View from 'components/View';
11import Passport from 'components/Passport';
12import { ForwardButton, BootArvoButton } from 'components/Buttons';
13import { matchBlinky } from 'components/Blinky';
15import useInvites from 'lib/useInvites';
16import { useSyncOwnedPoints } from 'lib/useSyncPoints';
17import useCurrentPermissions from 'lib/useCurrentPermissions';
19export default function Point() {
20 const { push, names } = useHistory();
21 const { pointCursor } = usePointCursor();
23 const point = need.point(pointCursor);
30 } = useCurrentPermissions();
32 // fetch the invites for the current cursor
33 const { availableInvites } = useInvites(point);
35 const goAdmin = useCallback(() => push(names.ADMIN), [push, names]);
37 const goInvite = useCallback(() => push(names.INVITE), [push, names]);
39 const goPartiesSetPoolSize = useCallback(
40 () => push(names.PARTY_SET_POOL_SIZE),
44 const goIssuePoint = useCallback(() => push(names.ISSUE_CHILD), [
49 const inviteButton = (() => {
50 switch (azimuth.getPointSize(point)) {
51 case azimuth.PointSize.Planet:
52 const availableInvitesText = matchBlinky(availableInvites);
58 disabled={!isActiveOwner}
60 Invite <sup>{availableInvitesText}</sup>
66 case azimuth.PointSize.Star:
72 disabled={!isActiveOwner}
73 onClick={goPartiesSetPoolSize}>
85 // sync the current cursor
86 useSyncOwnedPoints([point]);
90 <Passport point={Just(point)} />
91 <Grid className="pt2">
107 onClick={goIssuePoint}>
113 <Grid.Item full as={BootArvoButton} disabled />
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