1import React from 'react';
2import * as need from 'lib/need';
3import { Grid, Text } from 'indigo-react';
5import { usePointCursor } from 'store/pointCursor';
6import { useHistory } from 'store/history';
8import View from 'components/View';
9import Crumbs from 'components/Crumbs';
10import Highlighted from 'components/Highlighted';
11import { matchBlinky } from 'components/Blinky';
13import useInvites from 'lib/useInvites';
14import { useSyncOwnedPoints } from 'lib/useSyncPoints';
15import useCurrentPointName from 'lib/useCurrentPointName';
16import useRouter from 'lib/useRouter';
17import { LocalRouterProvider } from 'lib/LocalRouter';
19import InviteUrl from './Invite/InviteUrl';
20import InviteEmail from './Invite/InviteEmail';
21import ViewHeader from 'components/ViewHeader';
33export default function Invite() {
34 const history = useHistory();
35 const { Route, ...router } = useRouter({
38 initialRoutes: [{ key: NAMES.URL }],
40 const { pointCursor } = usePointCursor();
41 const point = need.point(pointCursor);
42 const name = useCurrentPointName();
44 // sync the current point
45 useSyncOwnedPoints([point]);
47 // get the invites for the current point
48 const { availableInvites, sentInvites, acceptedInvites } = useInvites(point);
50 // number or loading character
51 const availableInvitesText = matchBlinky(availableInvites);
52 const sentInvitesText = matchBlinky(sentInvites);
53 const acceptedInvitesText = matchBlinky(acceptedInvites);
56 <LocalRouterProvider value={router}>
58 <Grid className="mb4">
64 action: () => history.pop(),
72 <Grid.Item full as={ViewHeader}>
75 <Grid.Item as={Text} className="f5" full>
76 You currently have{' '}
77 <Highlighted>{availableInvitesText} invitations</Highlighted> left.
79 Out of the <Highlighted>{sentInvitesText}</Highlighted> invites you
80 sent, <Highlighted>{acceptedInvitesText}</Highlighted> have been
86 </LocalRouterProvider>
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