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 { useHistory } from 'store/history';
9import View from 'components/View';
10import Passport from 'components/Passport';
11import { ForwardButton } from 'components/Buttons';
12import FooterButton from 'components/FooterButton';
13import { matchBlinky } from 'components/Blinky';
15import useInvites from 'lib/useInvites';
16import { useSyncOwnedPoints } from 'lib/useSyncPoints';
17import { ROUTE_NAMES } from 'lib/routeNames';
19import Actions from './Point/Actions';
20import { useWallet } from 'store/wallet';
21import usePermissionsForPoint from 'lib/usePermissionsForPoint';
23export default function Point() {
24 const history = useHistory();
25 const { pointCursor } = usePointCursor();
26 const { wallet } = useWallet();
28 const point = need.point(pointCursor);
30 const { canManage } = usePermissionsForPoint(
31 // using empty string should be ok here
34 Just: p => p.value.address,
39 // fetch the invites for the current cursor
40 const { availableInvites } = useInvites(point);
41 const availableInvitesText = matchBlinky(availableInvites);
43 const showActions = Just.hasInstance(wallet);
45 const goAdmin = useCallback(() => history.push(ROUTE_NAMES.ADMIN), [history]);
47 const goInvite = useCallback(() => history.push(ROUTE_NAMES.INVITE), [
51 // sync the current cursor
52 useSyncOwnedPoints([point]);
56 <Passport point={Just(point)} />
57 <Grid className="pt2">
66 <Grid.Item full as={ForwardButton} detail="Boot your computer" disabled>
76 <FooterButton disabled={!canManage} onClick={goInvite}>
77 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