1import React from 'react';
10import { GenerateButton, ForwardButton, RestartButton } from './Buttons';
11import { useCheckboxInput } from 'lib/useInputs';
12import Blinky from './Blinky';
14export default function InlineEthereumTransaction({
15 // from useEthereumTransaction.bind
32 const [configureInput, { data: configurationOpen }] = useCheckboxInput({
34 label: 'Configure Transaction',
35 disabled: signed || broadcasted || confirmed,
39 viewSignedTransaction,
40 { data: signedTransactionOpen },
41 ] = useCheckboxInput({
43 label: 'View Signed Transaction',
47 // show receipt after successful broadcast
48 const showReceipt = broadcasted || confirmed;
49 // show configure controls pre-broadcast
50 const showConfigureInput = !(broadcasted || confirmed);
51 // show signed tx after signing
52 const showSignedTx = signed;
54 const renderButton = () => {
57 <Grid.Item full as={RestartButton} solid onClick={() => reset()}>
61 } else if (confirmed) {
65 <Grid.Item full as={RestartButton} onClick={onReturn}>
70 } else if (broadcasted) {
78 accessory={<Blinky />}>
79 Sending Transaction...
89 onClick={() => broadcast()}>
98 onClick={generateAndSign}
100 accessory={!canSign && initializing ? <Blinky /> : undefined}>
101 Generate & Sign Transaction
108 <Grid className={className}>
112 <Grid.Item full as={ErrorText} className="mt1">
117 {showConfigureInput && (
118 <Grid.Item full as={ToggleInput} {...configureInput} />
122 <Grid.Item full as={ToggleInput} {...viewSignedTransaction} />
128 <Grid.Item full as={Flex} col className="pv4">
129 <Flex.Item as={Flex} row justify="between">
130 <Flex.Item as={H5}>Transaction Hash</Flex.Item>
131 <Flex.Item as={LinkButton} href="https://google.com">
135 <Flex.Item as={Flex}>
136 <Flex.Item flex as="code" className="f6 mono gray4 wrap">
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