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';
9import { useHistory } from 'store/history';
11import * as need from 'lib/need';
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 MiniBackButton from 'components/MiniBackButton';
20import InlineEthereumTransaction from 'components/InlineEthereumTransaction';
21import View from 'components/View';
23function useRejectTransfer() {
24 const { contracts } = useNetwork();
25 const { pointCursor } = usePointCursor();
26 const { syncDetails, syncControlledPoints } = usePointCache();
28 const _contracts = need.contracts(contracts);
29 const _point = need.point(pointCursor);
31 const { construct, ...rest } = useEthereumTransaction(
34 azimuth.ecliptic.setTransferProxy(_contracts, _point, ETH_ZERO_ADDR),
38 () => Promise.all([syncDetails(_point), syncControlledPoints()]),
39 [_point, syncControlledPoints, syncDetails]
53export default function RejectTransfer() {
54 const { pop } = useHistory();
55 const { getDetails } = usePointCache();
56 const { pointCursor } = usePointCursor();
57 const _point = need.point(pointCursor);
59 const name = useCurrentPointName();
60 const _details = need.details(getDetails(_point));
62 const { completed, bind } = useRejectTransfer();
67 <Grid.Item full as={MiniBackButton} onClick={() => pop()} />
69 <Grid.Item full as={ViewHeader}>
70 Reject Incoming Transfer
80 ? `The incoming transfer of ${name} has been rejected.`
81 : `Reject the incoming transfer of ${name} from ${_details.owner}.`}
86 as={InlineEthereumTransaction}
88 onReturn={() => pop()}
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