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 FooterButton from 'components/FooterButton';
14import { matchBlinky } from 'components/Blinky';
16import useInvites from 'lib/useInvites';
17import { useSyncOwnedPoints } from 'lib/useSyncPoints';
18import useCurrentPermissions from 'lib/useCurrentPermissions';
20export default function Point() {
21 const { push, names } = useHistory();
22 const { pointCursor } = usePointCursor();
24 const point = need.point(pointCursor);
31 } = useCurrentPermissions();
33 // fetch the invites for the current cursor
34 const { availableInvites } = useInvites(point);
36 const goAdmin = useCallback(() => push(names.ADMIN), [push, names]);
38 const goInvite = useCallback(() => push(names.INVITE), [push, names]);
40 const goPartiesSetPoolSize = useCallback(
41 () => push(names.PARTY_SET_POOL_SIZE),
45 const goIssuePoint = useCallback(() => push(names.ISSUE_CHILD), [
50 const inviteButton = (() => {
51 switch (azimuth.getPointSize(point)) {
52 case azimuth.PointSize.Planet:
53 const availableInvitesText = matchBlinky(availableInvites);
55 <FooterButton disabled={!isActiveOwner} onClick={goInvite}>
56 Invite <sup>{availableInvitesText} available</sup>
60 case azimuth.PointSize.Star:
63 disabled={!isActiveOwner}
64 onClick={goPartiesSetPoolSize}>
74 // sync the current cursor
75 useSyncOwnedPoints([point]);
79 <Passport point={Just(point)} />
80 <Grid className="pt2">
95 onClick={goIssuePoint}>
101 <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