mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Fold submit and buy ether into one button slot
This commit is contained in:
parent
34e7bb5015
commit
3a87a30912
@ -66,6 +66,7 @@ PendingTx.prototype.render = function () {
|
||||
|
||||
const balanceBn = hexToBn(balance)
|
||||
const insufficientBalance = balanceBn.lt(maxCost)
|
||||
const buyDisabled = insufficientBalance || !this.state.valid || !isValidAddress || this.state.submitting
|
||||
|
||||
this.inputs = []
|
||||
|
||||
@ -297,14 +298,6 @@ PendingTx.prototype.render = function () {
|
||||
margin: '14px 25px',
|
||||
},
|
||||
}, [
|
||||
|
||||
|
||||
insufficientBalance ?
|
||||
h('button.btn-green', {
|
||||
onClick: props.buyEth,
|
||||
}, 'Buy Ether')
|
||||
: null,
|
||||
|
||||
h('button', {
|
||||
onClick: (event) => {
|
||||
this.resetGasFields()
|
||||
@ -312,13 +305,14 @@ PendingTx.prototype.render = function () {
|
||||
},
|
||||
}, 'Reset'),
|
||||
|
||||
// Accept Button
|
||||
h('input.confirm.btn-green', {
|
||||
type: 'submit',
|
||||
value: 'SUBMIT',
|
||||
style: { marginLeft: '10px' },
|
||||
disabled: insufficientBalance || !this.state.valid || !isValidAddress || this.state.submitting,
|
||||
}),
|
||||
// Accept Button or Buy Button
|
||||
insufficientBalance ? h('button.btn-green', { onClick: props.buyEth }, 'Buy Ether') :
|
||||
h('input.confirm.btn-green', {
|
||||
type: 'submit',
|
||||
value: 'SUBMIT',
|
||||
style: { marginLeft: '10px' },
|
||||
disabled: buyDisabled,
|
||||
}),
|
||||
|
||||
h('button.cancel.btn-red', {
|
||||
onClick: props.cancelTransaction,
|
||||
|
Loading…
Reference in New Issue
Block a user