aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/pending-tx.js
diff options
context:
space:
mode:
authorKevin Serrano <kevgagser@gmail.com>2017-03-01 08:54:10 +0800
committerGitHub <noreply@github.com>2017-03-01 08:54:10 +0800
commitf162a11585392df5e593018a02549f8b03018d22 (patch)
treec91dae0c308fb41a461fe85ce4cbeca5b49211df /ui/app/components/pending-tx.js
parentab01fef1c0ffddf09a20f90a910e5e068cf8c71e (diff)
parenta600ccd4f863d7a473392fc283f4cec248225a27 (diff)
downloadtangerine-wallet-browser-f162a11585392df5e593018a02549f8b03018d22.tar.gz
tangerine-wallet-browser-f162a11585392df5e593018a02549f8b03018d22.tar.zst
tangerine-wallet-browser-f162a11585392df5e593018a02549f8b03018d22.zip
Merge pull request #1154 from MetaMask/i765-gaslimits
Add ability to customize gas and gasPrice on tx confirmation screen
Diffstat (limited to 'ui/app/components/pending-tx.js')
-rw-r--r--ui/app/components/pending-tx.js26
1 files changed, 17 insertions, 9 deletions
diff --git a/ui/app/components/pending-tx.js b/ui/app/components/pending-tx.js
index 96f968929..d39cbc0f8 100644
--- a/ui/app/components/pending-tx.js
+++ b/ui/app/components/pending-tx.js
@@ -2,6 +2,7 @@ const Component = require('react').Component
const h = require('react-hyperscript')
const inherits = require('util').inherits
const PendingTxDetails = require('./pending-tx-details')
+const extend = require('xtend')
module.exports = PendingTx
@@ -11,8 +12,9 @@ function PendingTx () {
}
PendingTx.prototype.render = function () {
- var state = this.props
- var txData = state.txData
+ const props = this.props
+ const newProps = extend(props, {ref: 'details'})
+ const txData = props.txData
return (
@@ -21,7 +23,7 @@ PendingTx.prototype.render = function () {
}, [
// tx info
- h(PendingTxDetails, state),
+ h(PendingTxDetails, newProps),
h('style', `
.conf-buttons button {
@@ -39,7 +41,7 @@ PendingTx.prototype.render = function () {
}, 'Transaction Error. Exception thrown in contract code.')
: null,
- state.insufficientBalance ?
+ props.insufficientBalance ?
h('span.error', {
style: {
marginLeft: 50,
@@ -57,20 +59,26 @@ PendingTx.prototype.render = function () {
},
}, [
- state.insufficientBalance ?
+ props.insufficientBalance ?
h('button.btn-green', {
- onClick: state.buyEth,
+ onClick: props.buyEth,
}, 'Buy Ether')
: null,
h('button.confirm', {
- disabled: state.insufficientBalance,
- onClick: state.sendTransaction,
+ disabled: props.insufficientBalance,
+ onClick: props.sendTransaction,
}, 'Accept'),
h('button.cancel.btn-red', {
- onClick: state.cancelTransaction,
+ onClick: props.cancelTransaction,
}, 'Reject'),
+
+ h('button', {
+ onClick: () => {
+ this.refs.details.resetGasFields()
+ },
+ }, 'Reset'),
]),
])
)