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';
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 { wallet } = useWallet();
26 const point = need.point(pointCursor);
33 } = useCurrentPermissions();
35 // fetch the invites for the current cursor
36 const { availableInvites } = useInvites(point);
38 const goAdmin = useCallback(() => push(names.ADMIN), [push, names]);
40 const goInvite = useCallback(() => push(names.INVITE), [push, names]);
42 const goPartiesSetPoolSize = useCallback(
43 () => push(names.PARTY_SET_POOL_SIZE),
47 const goIssuePoint = useCallback(() => push(names.ISSUE_CHILD), [
52 const inviteButton = (() => {
53 switch (azimuth.getPointSize(point)) {
54 case azimuth.PointSize.Planet:
55 const availableInvitesText = matchBlinky(availableInvites);
61 disabled={!isActiveOwner}
63 Invite <sup>{availableInvitesText}</sup>
69 case azimuth.PointSize.Star:
75 disabled={!isActiveOwner}
76 onClick={goPartiesSetPoolSize}>
88 // sync the current cursor
89 useSyncOwnedPoints([point]);
91 const address = need.addressFromWallet(wallet);
94 <View pop={pop} inset>
95 <Greeting point={point} />
98 address={Just(address)}
99 animationMode={'none'}
101 <Grid className="pt2">
106 disabled={!canManage}
117 onClick={goIssuePoint}>
123 <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