@@ -3,31 +3,35 @@ import { Grid } from 'indigo-react';
3import * as ob from 'urbit-ob';
3import * as ob from 'urbit-ob';
4import { ecliptic } from 'azimuth-js';
4import { ecliptic } from 'azimuth-js';
6−import View from 'components/View';
7−import InlineEthereumTransaction from 'components/InlineEthereumTransaction';
8−import ViewHeader from 'components/ViewHeader';
10import { useNetwork } from 'store/network';
6import { useNetwork } from 'store/network';
11import { usePointCache } from 'store/pointCache';
7import { usePointCache } from 'store/pointCache';
12import { usePointCursor } from 'store/pointCursor';
8import { usePointCursor } from 'store/pointCursor';
13import { useHistory } from 'store/history';
9import { useHistory } from 'store/history';
11+import * as need from 'lib/need';
15import { GAS_LIMITS } from 'lib/constants';
12import { GAS_LIMITS } from 'lib/constants';
16import useEthereumTransaction from 'lib/useEthereumTransaction';
13import useEthereumTransaction from 'lib/useEthereumTransaction';
17−import * as need from 'lib/need';
14+
15+import InlineEthereumTransaction from 'components/InlineEthereumTransaction';
16+import Window from 'components/L2/Window/Window';
17+import HeaderPane from 'components/L2/Window/HeaderPane';
18+import BodyPane from 'components/L2/Window/BodyPane';
19+import View from 'components/View';
20+import L2BackHeader from 'components/L2/Headers/L2BackHeader';
21+import { Row } from '@tlon/indigo-react';
19function useAdopt() {
23function useAdopt() {
20− const { contracts } = useNetwork();
24+ const { contracts }: any = useNetwork();
21 const _contracts = need.contracts(contracts);
25 const _contracts = need.contracts(contracts);
23− const { pointCursor } = usePointCursor();
27+ const { pointCursor }: any = usePointCursor();
24 const point = need.point(pointCursor);
28 const point = need.point(pointCursor);
26− const { syncResidents } = usePointCache();
30+ const { syncResidents }: any = usePointCache();
28 return useEthereumTransaction(
32 return useEthereumTransaction(
29 useCallback(
33 useCallback(
30− (adoptee, denied) =>
34+ (adoptee: number, denied: boolean) =>
32 ? ecliptic.reject(_contracts, adoptee)
36 ? ecliptic.reject(_contracts, adoptee)
33 : ecliptic.adopt(_contracts, adoptee),
37 : ecliptic.adopt(_contracts, adoptee),
@@ -39,7 +43,7 @@ function useAdopt() {
41export default function Adopt() {
45export default function Adopt() {
42− const { pop, data } = useHistory();
46+ const { pop, data }: any = useHistory();
44 const { adoptee, denied } = data;
48 const { adoptee, denied } = data;
@@ -51,12 +55,12 @@ export default function Adopt() {
52 denied ? (
56 denied ? (
54− {completed ? 'Denied' : 'Denying'} adoption request to{' '}
58+ {completed ? 'Rejected' : 'Rejecting'} adoption request for{' '}
55 <span className="mono">{patp}</span>
59 <span className="mono">{patp}</span>
59− {completed ? 'Approved' : 'Approving'} adoption request to{' '}
63+ {completed ? 'Approved' : 'Approving'} adoption request for{' '}
60 <span className="mono">{patp}</span>
64 <span className="mono">{patp}</span>
@@ -67,22 +71,33 @@ export default function Adopt() {
67 construct(adoptee, denied);
71 construct(adoptee, denied);
68 }, [construct, adoptee, denied]);
72 }, [construct, adoptee, denied]);
74+ const headerText = `${denied ? 'Reject' : 'Approve'} Adoption Request`;
71− <View pop={() => pop()} inset>
79+ pop={pop}
73− <Grid.Item full as={ViewHeader} className="mb2">
81+ hideBack
74− Adopt
82+ header={<L2BackHeader hideBalance back={pop} />}>
75− </Grid.Item>
83+ <Window>
85+ <Row className="header-row">
86+ <h5>{headerText}</h5>
76− <Grid.Item full className="gray4 f5 mv2">
90+ <Grid.Item className="f5 mv2 w-full" style={{ fontSize: 14 }}>
78− </Grid.Item>
92+ </Grid.Item>
79− <Grid.Item
93+ <Grid.Item
81− {...bind}
95+ {...bind}
82− as={InlineEthereumTransaction}
96+ as={InlineEthereumTransaction}
83− onReturn={() => pop()}
97+ onReturn={() => pop()}
85− </Grid>
99+ </BodyPane>