@@ -7,6 +7,8 @@ import {
8 LinkButton,
8 LinkButton,
10} from 'indigo-react';
12} from 'indigo-react';
11import { GenerateButton, ForwardButton, RestartButton } from './Buttons';
13import { GenerateButton, ForwardButton, RestartButton } from './Buttons';
12import { useCheckboxInput } from 'lib/useInputs';
14import { useCheckboxInput } from 'lib/useInputs';
@@ -25,20 +27,30 @@ export default function InlineEthereumTransaction({
25 confirmed,
27 confirmed,
28 setGasPrice,
31 setGasPrice,
30 signedTransaction,
35 signedTransaction,
32 // additional from parent
37 // additional from parent
33 className,
38 className,
41+ // show receipt after successful broadcast
42+ const showReceipt = broadcasted || confirmed;
43+ // show configure controls pre-broadcast
44+ const showConfigureInput = !(signed || broadcasted || confirmed);
45+ // show signed tx after signing
46+ const showSignedTx = signed;
36 const exploreHashUrl = useExploreTxUrl(txHash);
48 const exploreHashUrl = useExploreTxUrl(txHash);
37− const [configureInput, { data: configurationOpen }] = useCheckboxInput({
49+ const [advancedInput, { data: advancedOpen }] = useCheckboxInput({
38− name: 'configure',
50+ name: 'advanced',
39− label: 'Configure Transaction',
51+ label: 'Advanced Configuration',
40− inverseLabel: 'Cancel Configure Transaction',
52+ inverseLabel: 'Hide Advanced Configuration',
41− disabled: signed || broadcasted || confirmed,
53+ disabled: !showConfigureInput,
@@ -48,16 +60,9 @@ export default function InlineEthereumTransaction({
48 name: 'viewsigned',
60 name: 'viewsigned',
49 label: 'View Signed Transaction',
61 label: 'View Signed Transaction',
50 inverseLabel: 'Hide Signed Transaction',
62 inverseLabel: 'Hide Signed Transaction',
51− disabled: !signed,
63+ disabled: !showSignedTx,
54− // show receipt after successful broadcast
55− const showReceipt = broadcasted || confirmed;
56− // show configure controls pre-broadcast
57− const showConfigureInput = !(broadcasted || confirmed);
58− // show signed tx after signing
59− const showSignedTx = signed;
61 const renderButton = () => {
66 const renderButton = () => {
62 if (error) {
67 if (error) {
@@ -122,7 +127,42 @@ export default function InlineEthereumTransaction({
124 {showConfigureInput && (
129 {showConfigureInput && (
125− <Grid.Item full as={ToggleInput} {...configureInput} />
132+ <Grid.Item full as={ToggleInput} {...advancedInput} />
135+ <Grid.Item full as={Flex} row justify="between" className="mt2">
136+ <Flex.Item as={H5}>Gas Price</Flex.Item>
137+ <Flex.Item as={H5}>{gasPrice} Gwei</Flex.Item>
146+ onChange={e => setGasPrice(parseInt(e.target.value, 10))}
154+ <Flex.Item as={Text}>Cheap</Flex.Item>
155+ <Flex.Item as={Text}>Fast</Flex.Item>
157+ <Grid.Item full as={HelpText} className="mt3">
160+ <Grid.Item full as={HelpText} className="mt1">
128 {showSignedTx && (
168 {showSignedTx && (