@@ -25,6 +25,91 @@ import { useLocalRouter } from 'lib/LocalRouter';
25import Inviter from 'views/Invite/Inviter';
25import Inviter from 'views/Invite/Inviter';
26import { usePointCache } from 'store/pointCache';
26import { usePointCache } from 'store/pointCache';
39+ const _totalInvites =
40+ sentInvites.getOrElse(0) + availableInvites.getOrElse(0);
41+ const _pendingInvites = pendingPoints.getOrElse([]).length;
45+ <Grid.Item cols={[1, 11]}>
51+ className={cn('t-right underline pointer-hover', {
52+ gray4: sentInvites.getOrElse(0) === 0,
59+ <Flex align="center">
61+ {acceptedInvites.getOrElse(0)} / {_totalInvites}
63+ {_pendingInvites > 0 && (
64+ <Flex.Item as={Chip} className="bg-yellow1 yellow4">
65+ {_pendingInvites} pending
76+ available={availableInvites}
78+ accepted={acceptedInvites}
83+ pendingPoints={pendingPoints}
84+ acceptedPoints={acceptedPoints}
90+ <Grid.Item full className="b-gray4 b-dotted b1 self-center">
91+ <div className="p4 pv8 t-center gray4">
92+ Start your invite group by adding members
97+ {!showInviteForm && availableInvites.getOrElse(0) > 0 && (
103+ onClick={() => setShowInviteForm(true)}>
107+ {showInviteForm && <Inviter />}
108+ <Grid.Item full className="mb2" />
28export default function Point() {
113export default function Point() {
29 const { pop, push, names } = useLocalRouter();
114 const { pop, push, names } = useLocalRouter();
30 const { pointCursor } = usePointCursor();
115 const { pointCursor } = usePointCursor();
@@ -61,10 +146,6 @@ export default function Point() {
62 const hasInvites = showInvites || availableInvites.getOrElse(0) !== 0;
147 const hasInvites = showInvites || availableInvites.getOrElse(0) !== 0;
64− const _totalInvites =
65− sentInvites.getOrElse(0) + availableInvites.getOrElse(0);
66− const _pendingInvites = pendingPoints.getOrElse([]).length;
68 const loadedInvites = Just.hasInstance(availableInvites);
149 const loadedInvites = Just.hasInstance(availableInvites);
70 // availableInvites.getOrElse(0) === 0
151 // availableInvites.getOrElse(0) === 0
@@ -135,89 +216,6 @@ export default function Point() {
136 const address = need.addressFromWallet(wallet);
217 const address = need.addressFromWallet(wallet);
138− const InviteForm = useCallback(() => {
141− <Grid.Item cols={[1, 11]}>
147− className={cn('t-right underline pointer-hover', {
148− gray4: sentInvites.getOrElse(0) === 0,
155− <Flex align="center">
157− {acceptedInvites.getOrElse(0)} / {_totalInvites}
159− {_pendingInvites > 0 && (
160− <Flex.Item as={Chip} className="bg-yellow1 yellow4">
161− {_pendingInvites} pending
172− available={availableInvites}
174− accepted={acceptedInvites}
178− as={InviteSigilList}
179− pendingPoints={pendingPoints}
180− acceptedPoints={acceptedPoints}
186− <Grid.Item full className="b-gray4 b-dotted b1 self-center">
187− <div className="p4 pv8 t-center gray4">
188− Start your invite group by adding members
193− {!showInviteForm && availableInvites.getOrElse(0) > 0 && (
199− onClick={() => setShowInviteForm(true)}>
203− {showInviteForm && <Inviter />}
204− <Grid.Item full className="mb2" />
221 const _requestCount = requestCount.getOrElse(0);
219 const _requestCount = requestCount.getOrElse(0);
@@ -247,7 +245,19 @@ export default function Point() {
248 </Grid.Item>
246 </Grid.Item>
250− {isPlanet && hasInvites && <InviteForm />}
248+ {isPlanet && hasInvites && (
250+ showInviteForm={showInviteForm}
251+ setShowInviteForm={setShowInviteForm}
252+ acceptedInvites={acceptedInvites}
253+ acceptedPoints={acceptedPoints}
254+ availableInvites={availableInvites}
256+ pendingPoints={pendingPoints}
257+ sentInvites={sentInvites}
258+ showInvites={showInvites}
251 {!loadedInvites && isPlanet && (
261 {!loadedInvites && isPlanet && (
252 <Grid.Item className="mv2" full>
262 <Grid.Item className="mv2" full>
253 Invite Group <Blinky />
263 Invite Group <Blinky />