@@ -12,15 +12,15 @@ import { useNetwork } from 'store/network';
1212import { useRollerStore } from 'store/rollerStore';
1313
1414import * as need from 'lib/need';
15−import { isZeroAddress, abbreviateAddress } from 'lib/utils/address';
15+import { abbreviateAddress } from 'lib/utils/address';
1616import useIsEclipticOwner from 'lib/useIsEclipticOwner';
1717import { useSyncDetails } from 'lib/useSyncPoints';
1818import useRejectedIncomingPointTransfers from 'lib/useRejectedIncomingPointTransfers';
1919import { pluralize } from 'lib/pluralize';
20+import Point from 'lib/types/Point';
2021import newGithubIssueUrl from 'new-github-issue-url';
2122
2223import View from 'components/View';
23−import Passport from 'components/Passport';
2424import Footer from 'components/Footer';
2525import { ForwardButton } from 'components/Buttons';
2626import CopiableAddress from 'components/copiable/CopiableAddress';
@@ -28,6 +28,7 @@ import NavHeader from 'components/NavHeader';
2828import L2PointHeader from 'components/L2/Headers/L2PointHeader';
2929import IncomingPoint from 'components/L2/Points/IncomingPoint';
3030import LoadingOverlay from 'components/L2/LoadingOverlay';
31+import PointList from 'components/L2/PointList';
3132import { Box, Text } from '@tlon/indigo-react';
3233
3334import './Points.scss';
@@ -42,56 +43,18 @@ export const maybeGetResult = (obj, key, defaultValue) =>
4243 }),
4344 });
4445
45−export const hasTransferProxy = details =>
46− !isZeroAddress(details.transferProxy);
47−
48−export const isLocked = (details, contracts) =>
46+export const isLocked = (details: any, contracts: any) =>
4947 details.owner === contracts.linearSR ||
5048 details.owner === contracts.conditionalSR;
5149
52−const PointList = function({
53− points,
54− className,
55− actions,
56− locked = false,
57− processing = false,
58− ...rest
59−}) {
60− const { setPointCursor } = usePointCursor();
61− const { push, names } = useHistory();
62−
63− return (
64− <Grid gap={4} className={className}>
65− {points.map((point, i) => (
66− <Grid.Item
67− key={point}
68− className={`full fourth-${(i % 4) + 1}-md fourth-${(i % 4) + 1}-lg`}>
69− <Flex col>
70− <Passport.Mini
71− locked={locked}
72− processing={processing}
73− point={point}
74− onClick={
75− locked || processing
76− ? undefined
77− : () => {
78− setPointCursor(Just(point));
79− push(names.POINT);
80− }
81− }
82− {...rest}
83− />
84− {actions && (
85− <Flex.Item className="mt2">{actions(point, i)}</Flex.Item>
86− )}
87− </Flex>
88− </Grid.Item>
89− ))}
90− </Grid>
91− );
92−};
50+interface ActionButtonProps {
51+ actions?: {
52+ text?: string;
53+ onClick?: () => void;
54+ }[];
55+}
9356
94−function ActionButtons({ actions = [] }) {
57+function ActionButtons({ actions = [] }: ActionButtonProps) {
9558 return (
9659 <Flex row>
9760 {actions.map(action => (
@@ -164,9 +127,7 @@ export default function Points() {
164127 [getDetails, controlledPoints, _contracts]
165128 );
166129
167− const allPoints = pointList
168− .filter(({ shouldDisplay }) => shouldDisplay)
169− .map(({ value }) => value);
130+ const allPoints = pointList.filter(({ shouldDisplay }) => shouldDisplay);
170131
171132 // if we can only interact with a single point, jump to the point page.
172133 // if there are any pending transfers, incoming or outgoing, stay on this
@@ -182,7 +143,7 @@ export default function Points() {
182143 (starReleaseDetails.value === null ||
183144 starReleaseDetails.value.total === 0)
184145 ) {
185− setPointCursor(Just(allPoints[0]));
146+ setPointCursor(Just(allPoints[0].value));
186147 push(names.POINT);
187148 }
188149 }, [
@@ -201,11 +162,13 @@ export default function Points() {
201162 const loading = Nothing.hasInstance(controlledPoints);
202163
203164 const ownedPoints = maybeGetResult(controlledPoints, 'ownedPoints', []);
204− const lockedPoints = maybeLockedPoints.getOrElse([]);
165+ const lockedPoints = maybeLockedPoints
166+ .getOrElse([])
167+ .map((value: number) => ({ value }));
205168
206− const processingPoints = pointList
207− .filter(({ shouldDisplay }) => !shouldDisplay)
208− .map(({ value }) => value);
169+ const processingPoints = pointList.filter(
170+ ({ shouldDisplay }) => !shouldDisplay
171+ );
209172
210173 const displayEmptyState =
211174 !loading && incomingPoints.length === 0 && allPoints.length === 0;
@@ -331,14 +294,14 @@ export default function Points() {
331294 <Grid.Item
332295 full
333296 as={PointList}
334− points={outgoingPoints.map(({ value }) => value)}
335− actions={(point, i) => (
297+ points={outgoingPoints}
298+ actions={(point: Point, i: number) => (
336299 <ActionButtons
337300 actions={[
338301 {
339302 text: 'Cancel',
340303 onClick: () => {
341− setPointCursor(Just(point));
304+ setPointCursor(Just(point.value));
342305 // TODO: deep linking to fix this duplicate route
343306 push(names.CANCEL_TRANSFER);
344307 },
@@ -358,11 +321,11 @@ export default function Points() {
358321
359322 {lockedPoints.length > 0 && (
360323 <Grid.Item full as={Grid} gap={1}>
361− <Grid.Item full as={PointList} locked points={allPoints} />
324+ <Grid.Item full as={PointList} locked points={lockedPoints} />
362325 </Grid.Item>
363326 )}
364327
365− {processingPoints.length > 0 && (
328+ {/* {processingPoints.length > 0 && (
366329 <Grid.Item full as={Grid} gap={1} className="mv6">
367330 <Grid.Item full as={H5}>
368331 Awaiting L2 Rollup
@@ -374,7 +337,7 @@ export default function Points() {
374337 processing
375338 />
376339 </Grid.Item>
377− )}
340+ )} */}
378341
379342 <Footer>
380343 <Grid>