1import React, { useCallback } from 'react';
2import { Just } from 'folktale/maybe';
3import * as need from 'lib/need';
4import { Grid } from 'indigo-react';
6import { usePointCursor } from 'store/pointCursor';
7import { usePointCache } from 'store/pointCache';
8import { useHistory } from 'store/history';
10import View from 'components/View';
11import Passport from 'components/Passport';
12import { ForwardButton } from 'components/Buttons';
13import FooterButton from 'components/FooterButton';
14import { matchBlinky } from 'components/Blinky';
16import useInvites from 'lib/useInvites';
17import { useSyncOwnedPoints } from 'lib/useSyncPoints';
18import { ROUTE_NAMES } from 'lib/routeNames';
20import Actions from './Point/Actions';
21import { useWallet } from 'store/wallet';
22import usePermissionsForPoint from 'lib/usePermissionsForPoint';
24export default function Point() {
25 const history = useHistory();
26 const { pointCursor } = usePointCursor();
27 const { wallet } = useWallet();
29 const point = need.point(pointCursor);
31 const { canManage } = usePermissionsForPoint(
32 // using empty string should be ok here
35 Just: p => p.value.address,
40 // fetch the invites for the current cursor
41 const { availableInvites } = useInvites(point);
42 const availableInvitesText = matchBlinky(availableInvites);
44 const showActions = Just.hasInstance(wallet);
46 const goAdmin = useCallback(() => history.push(ROUTE_NAMES.ADMIN), [history]);
48 const goInvite = useCallback(() => history.push(ROUTE_NAMES.INVITE), [
52 // sync the current cursor
53 useSyncOwnedPoints([point]);
57 <Passport point={Just(point)} />
58 <Grid className="pt2">
67 <Grid.Item full as={ForwardButton} detail="Boot your computer" disabled>
77 <FooterButton disabled={!canManage} onClick={goInvite}>
78 Invite <sup>{availableInvitesText} available</sup>
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