1import React, { useCallback } from 'react';
2import cn from 'classnames';
3import { Grid, Text } from 'indigo-react';
4import * as azimuth from 'azimuth-js';
6import { useNetwork } from 'store/network';
7import { usePointCursor } from 'store/pointCursor';
8import { usePointCache } from 'store/pointCache';
10import * as need from 'lib/need';
11import { useLocalRouter } from 'lib/LocalRouter';
12import useCurrentPointName from 'lib/useCurrentPointName';
13import useEthereumTransaction from 'lib/useEthereumTransaction';
14import { GAS_LIMITS } from 'lib/constants';
15import { ETH_ZERO_ADDR } from 'lib/wallet';
16import useLifecycle from 'lib/useLifecycle';
18import ViewHeader from 'components/ViewHeader';
19import InlineEthereumTransaction from 'components/InlineEthereumTransaction';
20import View from 'components/ViewHeader';
22function useCancelTransfer() {
23 const { contracts } = useNetwork();
24 const { pointCursor } = usePointCursor();
25 const { syncDetails } = usePointCache();
27 const _contracts = need.contracts(contracts);
28 const _point = need.point(pointCursor);
30 const { construct, ...rest } = useEthereumTransaction(
33 azimuth.ecliptic.setTransferProxy(_contracts, _point, ETH_ZERO_ADDR),
36 useCallback(() => syncDetails(_point), [_point, syncDetails]),
49function AdminCancelTransfer() {
50 const { pop } = useLocalRouter();
51 const { getDetails } = usePointCache();
52 const { pointCursor } = usePointCursor();
53 const _point = need.point(pointCursor);
55 const name = useCurrentPointName();
56 const _details = need.details(getDetails(_point));
58 const { completed, bind } = useCancelTransfer();
62 <Grid.Item full as={ViewHeader}>
63 Cancel Outgoing Transfer
69 className={cn('f5 wrap', {
73 ? `The outgoing transfer of ${name} has been cancelled.`
74 : `Cancel the outgoing transfer of ${name} to ${_details.transferProxy}.`}
79 as={InlineEthereumTransaction}
81 onReturn={() => pop()}
87export default function CancelTransfer() {
88 const { pop } = useLocalRouter();
91 <View pop={pop} inset>
92 <AdminCancelTransfer />
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