@@ -9,7 +9,7 @@ import { renderSignedTx, signTransaction } from '../lib/txn'
99
1010const StatelessTransaction = props => {
1111 const { web3, gasPrice, gasLimit, nonce, chainId } = props
12− const { setNonce, setChainId, setGasLimit, setGasPrice } = props
12+ const { setNonce, setChainId, setGasLimit, setGasPrice, showGasDetails, toggleGasDetails } = props
1313 const { txn, stx, createUnsignedTxn } = props
1414 const { canSign, canGenerate, canApprove } = props
1515 const { setUserApproval, userApproval } = props
@@ -18,6 +18,10 @@ const StatelessTransaction = props => {
1818 // setState doesn't seem to work in SetProxy/handleSubmit, so just
1919 // modifying the DOM manually here. (https://imgur.com/a/i0Qsyq1)
2020
21+ const handleRangeChange = (e) => {
22+ setGasPrice(e.target.value);
23+ }
24+
2125 const sendTxn = (e) => {
2226 e.target.setAttribute("disabled", true);
2327 let spinner = e.target.querySelectorAll('.btn-spinner')[0];
@@ -59,6 +63,31 @@ const StatelessTransaction = props => {
5963 </React.Fragment>
6064 })
6165
66+ const gasPriceRangeDialogue = (
67+ <React.Fragment>
68+ <div className="mt-8">Gas Price: <span className="ml-4 text-700 text-sm">{gasPrice} gwei</span></div>
69+
70+ <input
71+ className="mt-4"
72+ type="range"
73+ min="4"
74+ max="20"
75+ list="gweiVals"
76+ value={gasPrice}
77+ onChange={handleRangeChange}
78+ />
79+
80+ <div className="flex space-between text-sm mb-8">
81+ <div>Cheap</div>
82+ <div>Fast</div>
83+ </div>
84+ </React.Fragment>
85+ )
86+
87+ const toggleGasDetailsDialogue = (
88+ <a href="javascript:void(0)" onClick={toggleGasDetails}>Gas Details</a>
89+ )
90+
6291 const gasPriceDialogue =
6392 <Input
6493 className={ 'mono mt-4' }
@@ -182,8 +211,15 @@ const StatelessTransaction = props => {
182211 { generateTxnButton }
183212 { unsignedTxnDisplay }
184213
185− { gasPriceDialogue }
186− { gasLimitDialogue }
214+ { gasPriceRangeDialogue }
215+ { toggleGasDetailsDialogue }
216+
217+ { showGasDetails &&
218+ <div>
219+ { gasPriceDialogue }
220+ { gasLimitDialogue }
221+ </div>
222+ }
187223 { onlineParamsDialogue }
188224
189225 { signTxnButton }