1import React, { useCallback } from 'react';
2import Maybe 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';
23export default function Point() {
24 const history = useHistory();
25 const { pointCursor } = usePointCursor();
26 const { pointCache } = usePointCache();
27 const { wallet } = useWallet();
29 const point = need.point(pointCursor);
30 const hasInCache = point in pointCache;
32 // fetch the invites for the current cursor
33 const { availableInvites } = useInvites(point);
34 const availableInvitesText = matchBlinky(availableInvites);
36 const showActions = Maybe.Just.hasInstance(wallet);
38 const goAdmin = useCallback(() => history.push(ROUTE_NAMES.ADMIN), [history]);
40 const goInvite = useCallback(() => history.push(ROUTE_NAMES.INVITE), [
44 // sync the current cursor
45 useSyncOwnedPoints([point]);
49 <Passport point={Maybe.Just(point)} />
50 <Grid className="pt2">
52 <ForwardButton disabled={!hasInCache} onClick={goAdmin}>
58 <ForwardButton detail="Boot your computer" disabled>
69 <FooterButton onClick={goInvite}>
70 Invite <sup>{availableInvitesText}</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