@@ -1,84 +0,0 @@
1−import React, { useCallback } from 'react';
2−import cn from 'classnames';
3−import { Grid, Text } from 'indigo-react';
4−import * as azimuth from 'azimuth-js';
5−
6−import { useNetwork } from 'store/network';
7−import { usePointCursor } from 'store/pointCursor';
8−import { usePointCache } from 'store/pointCache';
9−
10−import * as need from 'lib/need';
11−import { useLocalRouter } from 'lib/LocalRouter';
12−import useCurrentPointName from 'lib/useCurrentPointName';
13−import useEthereumTransaction from 'lib/useEthereumTransaction';
14−import { GAS_LIMITS } from 'lib/constants';
15−import { ETH_ZERO_ADDR } from 'lib/wallet';
16−import useLifecycle from 'lib/useLifecycle';
17−
18−import ViewHeader from 'components/ViewHeader';
19−import InlineEthereumTransaction from 'components/InlineEthereumTransaction';
20−
21−function useCancelTransfer() {
22− const { contracts } = useNetwork();
23− const { pointCursor } = usePointCursor();
24− const { syncDetails } = usePointCache();
25−
26− const _contracts = need.contracts(contracts);
27− const _point = need.point(pointCursor);
28−
29− const { construct, ...rest } = useEthereumTransaction(
30− useCallback(
31− () =>
32− azimuth.ecliptic.setTransferProxy(_contracts, _point, ETH_ZERO_ADDR),
33− [_contracts, _point]
34− ),
35− useCallback(() => syncDetails(_point), [_point, syncDetails]),
36− GAS_LIMITS.SET_PROXY
37− );
38−
39− useLifecycle(() => {
40− construct();
41− });
42−
43− return {
44− ...rest,
45− };
46−}
47−
48−export default function AdminCancelTransfer() {
49− const { pop } = useLocalRouter();
50− const { getDetails } = usePointCache();
51− const { pointCursor } = usePointCursor();
52− const _point = need.point(pointCursor);
53−
54− const name = useCurrentPointName();
55− const _details = need.details(getDetails(_point));
56−
57− const { completed, bind } = useCancelTransfer();
58−
59− return (
60− <Grid>
61− <Grid.Item full as={ViewHeader}>
62− Cancel Outgoing Transfer
63− </Grid.Item>
64−
65− <Grid.Item
66− full
67− as={Text}
68− className={cn('f5 wrap', {
69− green3: completed,
70− })}>
71− {completed
72− ? `The outgoing transfer of ${name} has been cancelled.`
73− : `Cancel the outgoing transfer of ${name} to ${_details.transferProxy}.`}
74− </Grid.Item>
75−
76− <Grid.Item
77− full
78− as={InlineEthereumTransaction}
79− {...bind}
80− onReturn={() => pop()}
81− />
82− </Grid>
83− );
84−}