@@ -9,7 +9,7 @@ import { renderSignedTx, signTransaction } from '../lib/txn'
10const StatelessTransaction = props => {
10const StatelessTransaction = props => {
11 const { web3, gasPrice, gasLimit, nonce, chainId } = props
11 const { web3, gasPrice, gasLimit, nonce, chainId } = props
12− const { setNonce, setChainId, setGasLimit, setGasPrice } = props
12+ const { setNonce, setChainId, setGasLimit, setGasPrice, showGasDetails, toggleGasDetails } = props
13 const { txn, stx, createUnsignedTxn } = props
13 const { txn, stx, createUnsignedTxn } = props
14 const { canSign, canGenerate, canApprove } = props
14 const { canSign, canGenerate, canApprove } = props
15 const { setUserApproval, userApproval } = props
15 const { setUserApproval, userApproval } = props
@@ -18,6 +18,10 @@ const StatelessTransaction = props => {
18 // setState doesn't seem to work in SetProxy/handleSubmit, so just
18 // setState doesn't seem to work in SetProxy/handleSubmit, so just
19 // modifying the DOM manually here. (https://imgur.com/a/i0Qsyq1)
19 // modifying the DOM manually here. (https://imgur.com/a/i0Qsyq1)
21+ const handleRangeChange = (e) => {
22+ setGasPrice(e.target.value);
21 const sendTxn = (e) => {
25 const sendTxn = (e) => {
22 e.target.setAttribute("disabled", true);
26 e.target.setAttribute("disabled", true);
23 let spinner = e.target.querySelectorAll('.btn-spinner')[0];
27 let spinner = e.target.querySelectorAll('.btn-spinner')[0];
@@ -59,6 +63,40 @@ const StatelessTransaction = props => {
59 </React.Fragment>
63 </React.Fragment>
66+ const gasPriceRangeDialogue = (
68+ <div className="mt-12 flex space-between align-baseline">
70+ <span>Gas Price:</span>
71+ <span className="ml-4 text-700 text-sm">{gasPrice} gwei</span>
73+ <div className="text-sm">
74+ <span>Max transaction fee: </span>
75+ <span className="text-700">{(gasPrice * gasLimit) / 1000000000} eth</span>
86+ onChange={handleRangeChange}
89+ <div className="flex space-between text-sm mb-8">
96+ const toggleGasDetailsDialogue = (
97+ <a href="javascript:void(0)" onClick={toggleGasDetails}>Gas Details</a>
62 const gasPriceDialogue =
100 const gasPriceDialogue =
64 className={ 'mono mt-4' }
102 className={ 'mono mt-4' }
@@ -182,8 +220,15 @@ const StatelessTransaction = props => {
182 { generateTxnButton }
220 { generateTxnButton }
183 { unsignedTxnDisplay }
221 { unsignedTxnDisplay }
223+ { gasPriceRangeDialogue }
224+ { toggleGasDetailsDialogue }
185− { gasPriceDialogue }
228+ { gasPriceDialogue }
186− { gasLimitDialogue }
229+ { gasLimitDialogue }
187 { onlineParamsDialogue }
232 { onlineParamsDialogue }
189 { signTxnButton }
234 { signTxnButton }