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 { ETH_ZERO_ADDR, GAS_LIMITS } from 'lib/constants';
15import useLifecycle from 'lib/useLifecycle';
17import ViewHeader from 'components/ViewHeader';
18import InlineEthereumTransaction from 'components/InlineEthereumTransaction';
19import View from 'components/ViewHeader';
21function useCancelTransfer() {
22 const { contracts } = useNetwork();
23 const { pointCursor } = usePointCursor();
24 const { syncDetails } = usePointCache();
26 const _contracts = need.contracts(contracts);
27 const _point = need.point(pointCursor);
29 const { construct, ...rest } = useEthereumTransaction(
32 azimuth.ecliptic.setTransferProxy(_contracts, _point, ETH_ZERO_ADDR),
35 useCallback(() => syncDetails(_point), [_point, syncDetails]),
48function AdminCancelTransfer() {
49 const { pop } = useLocalRouter();
50 const { getDetails } = usePointCache();
51 const { pointCursor } = usePointCursor();
52 const _point = need.point(pointCursor);
54 const name = useCurrentPointName();
55 const _details = need.details(getDetails(_point));
57 const { completed, bind } = useCancelTransfer();
61 <Grid.Item full as={ViewHeader}>
62 Cancel Outgoing Transfer
68 className={cn('f5 wrap', {
72 ? `The outgoing transfer of ${name} has been cancelled.`
73 : `Cancel the outgoing transfer of ${name} to ${_details.transferProxy}.`}
78 as={InlineEthereumTransaction}
80 onReturn={() => pop()}
86export default function CancelTransfer() {
87 const { pop } = useLocalRouter();
90 <View pop={pop} inset>
91 <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