1import React from 'react';
2import * as need from 'lib/need';
3import { Grid, H5, 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';
32export default function Invite() {
33 const history = useHistory();
34 const { Route, ...router } = useRouter({
37 initialRoutes: [{ key: NAMES.URL }],
39 const { pointCursor } = usePointCursor();
40 const point = need.point(pointCursor);
41 const name = useCurrentPointName();
43 // sync the current point
44 useSyncOwnedPoints([point]);
46 // get the invites for the current point
47 const { availableInvites, sentInvites, acceptedInvites } = useInvites(point);
49 // number or loading character
50 const availableInvitesText = matchBlinky(availableInvites);
51 const sentInvitesText = matchBlinky(sentInvites);
52 const acceptedInvitesText = matchBlinky(acceptedInvites);
55 <LocalRouterProvider value={router}>
57 <Grid className="mb4">
63 action: () => history.pop(),
71 <Grid.Item as={H5} className="mv4" full>
74 <Grid.Item as={Text} className="f5" full>
75 You currently have{' '}
76 <Highlighted>{availableInvitesText} invitations</Highlighted> left.
78 Out of the <Highlighted>{sentInvitesText}</Highlighted> invites you
79 sent, <Highlighted>{acceptedInvitesText}</Highlighted> have been
85 </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