diff options
author | Kevin Serrano <kevgagser@gmail.com> | 2017-02-28 05:53:43 +0800 |
---|---|---|
committer | Kevin Serrano <kevgagser@gmail.com> | 2017-02-28 05:53:43 +0800 |
commit | a77a5f0ab329433404893ff1280fb90ff2a12029 (patch) | |
tree | 364217139a952fd3f53ea37c5f24218ea34c53cb | |
parent | c46f3d59de1201e800e7cee22a593d26dfb575bd (diff) | |
download | tangerine-wallet-browser-a77a5f0ab329433404893ff1280fb90ff2a12029.tar tangerine-wallet-browser-a77a5f0ab329433404893ff1280fb90ff2a12029.tar.gz tangerine-wallet-browser-a77a5f0ab329433404893ff1280fb90ff2a12029.tar.bz2 tangerine-wallet-browser-a77a5f0ab329433404893ff1280fb90ff2a12029.tar.lz tangerine-wallet-browser-a77a5f0ab329433404893ff1280fb90ff2a12029.tar.xz tangerine-wallet-browser-a77a5f0ab329433404893ff1280fb90ff2a12029.tar.zst tangerine-wallet-browser-a77a5f0ab329433404893ff1280fb90ff2a12029.zip |
Move input boxes into table and into details component.
-rw-r--r-- | ui/app/components/hex-as-decimal-input.js | 5 | ||||
-rw-r--r-- | ui/app/components/pending-tx-details.js | 35 | ||||
-rw-r--r-- | ui/app/components/pending-tx.js | 16 |
3 files changed, 39 insertions, 17 deletions
diff --git a/ui/app/components/hex-as-decimal-input.js b/ui/app/components/hex-as-decimal-input.js index 4d3105b8d..34f628f7f 100644 --- a/ui/app/components/hex-as-decimal-input.js +++ b/ui/app/components/hex-as-decimal-input.js @@ -27,6 +27,10 @@ HexAsDecimalInput.prototype.render = function () { return ( h('input', { + style: { + display: 'block', + textAlign: 'right', + }, value: decimalValue, onChange: (event) => { const hexString = hexify(event.target.value) @@ -46,4 +50,3 @@ function decimalize (input) { const inputBN = new BN(strippedInput, 'hex') return inputBN.toString(10) } - diff --git a/ui/app/components/pending-tx-details.js b/ui/app/components/pending-tx-details.js index e8615404e..973f6ac92 100644 --- a/ui/app/components/pending-tx-details.js +++ b/ui/app/components/pending-tx-details.js @@ -7,6 +7,8 @@ const EthBalance = require('./eth-balance') const util = require('../util') const addressSummary = util.addressSummary const nameForAddress = require('../../lib/contract-namer') +const HexInput = require('./hex-as-decimal-input') + module.exports = PendingTxDetails @@ -20,6 +22,7 @@ const PTXP = PendingTxDetails.prototype PTXP.render = function () { var props = this.props var txData = props.txData + var state = this.state || {} var txParams = txData.txParams || {} var address = txParams.from || props.selectedAddress @@ -27,6 +30,9 @@ PTXP.render = function () { var account = props.accounts[address] var balance = account ? account.balance : '0x0' + const gas = state.gas || txParams.gas + const gasPrice = state.gasPrice || txData.gasPrice + var txFee = txData.txFee || '' var maxCost = txData.maxCost || '' var dataLength = txParams.data ? (txParams.data.length - 2) / 2 : 0 @@ -129,7 +135,36 @@ PTXP.render = function () { }), ]), ]), + h('.cell.row', { + }, [ + h('.cell.label', 'Total Gas'), + h('.cell.value', { + + }, [ + h(HexInput, { + value: gas, + onChange: (newHex) => { + this.setState({ gas: newHex }) + }, + }), + ]) + ]), + h('.cell.row', { + + }, [ + h('.cell.label', 'Gas Price'), + h('.cell.value', { + + }, [ + h(HexInput, { + value: gasPrice, + onChange: (newHex) => { + this.setState({ gas: newHex }) + }, + }), + ]) + ]), h('.cell.row', { style: { background: '#f7f7f7', diff --git a/ui/app/components/pending-tx.js b/ui/app/components/pending-tx.js index f1f479794..23b0dc00f 100644 --- a/ui/app/components/pending-tx.js +++ b/ui/app/components/pending-tx.js @@ -2,7 +2,6 @@ const Component = require('react').Component const h = require('react-hyperscript') const inherits = require('util').inherits const PendingTxDetails = require('./pending-tx-details') -const HexInput = require('./hex-as-decimal-input') module.exports = PendingTx @@ -78,21 +77,6 @@ PendingTx.prototype.render = function () { onClick: props.cancelTransaction, }, 'Reject'), ]), - - h(HexInput, { - value: gas, - onChange: (newHex) => { - this.setState({ gas: newHex }) - }, - }), - - h(HexInput, { - value: gasPrice, - onChange: (newHex) => { - this.setState({ gasPrice: newHex }) - }, - }), - ]) ) } |