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);
26 const { isActiveOwner, canManage } = useCurrentPermissions();
28 // fetch the invites for the current cursor
29 const { availableInvites } = useInvites(point);
31 const goAdmin = useCallback(() => push(names.ADMIN), [push, names]);
33 const goInvite = useCallback(() => push(names.INVITE), [push, names]);
35 const goPartiesSetPoolSize = useCallback(
36 () => push(names.PARTY_SET_POOL_SIZE),
40 const inviteButton = (() => {
41 switch (azimuth.getPointSize(point)) {
42 case azimuth.PointSize.Planet:
43 const availableInvitesText = matchBlinky(availableInvites);
45 <FooterButton disabled={!isActiveOwner} onClick={goInvite}>
46 Invite <sup>{availableInvitesText} available</sup>
50 case azimuth.PointSize.Star:
53 disabled={!isActiveOwner}
54 onClick={goPartiesSetPoolSize}>
64 // sync the current cursor
65 useSyncOwnedPoints([point]);
69 <Passport point={Just(point)} />
70 <Grid className="pt2">
79 <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