aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/pages/confirm-transaction-base/confirm-transaction-base.component.js
diff options
context:
space:
mode:
authorDan J Miller <danjm.com@gmail.com>2019-02-06 08:24:28 +0800
committerDan Finlay <542863+danfinlay@users.noreply.github.com>2019-02-06 08:24:28 +0800
commit38b91f63a21d1563cf88307e280f52836df005db (patch)
tree4632fe335ab9ff05df98f6739891a00a5229d90c /ui/app/components/pages/confirm-transaction-base/confirm-transaction-base.component.js
parentc28fa312503b7c868bfcfceb42b3a79c0f25d492 (diff)
downloadtangerine-wallet-browser-38b91f63a21d1563cf88307e280f52836df005db.tar
tangerine-wallet-browser-38b91f63a21d1563cf88307e280f52836df005db.tar.gz
tangerine-wallet-browser-38b91f63a21d1563cf88307e280f52836df005db.tar.bz2
tangerine-wallet-browser-38b91f63a21d1563cf88307e280f52836df005db.tar.lz
tangerine-wallet-browser-38b91f63a21d1563cf88307e280f52836df005db.tar.xz
tangerine-wallet-browser-38b91f63a21d1563cf88307e280f52836df005db.tar.zst
tangerine-wallet-browser-38b91f63a21d1563cf88307e280f52836df005db.zip
Add togglable advanced gas controls on send and confirm screens (#6112)
* Extract advanced gas input controls to their own component * Add advanced inline gas toggle to settings * Add optional advanced inline gas to send send screen * Adds optional advanced gas inputs to the confirm screen * Add info modals for advanced gas inputs. * Fix translation of advance gas toggle description. * Lint and unit test fixes for inline-advanced-gas-inputs * Increase margin above advanced options button on send screen * Move methods from constructor to property syntax in advanced-gas-inputs.component
Diffstat (limited to 'ui/app/components/pages/confirm-transaction-base/confirm-transaction-base.component.js')
-rw-r--r--ui/app/components/pages/confirm-transaction-base/confirm-transaction-base.component.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/ui/app/components/pages/confirm-transaction-base/confirm-transaction-base.component.js b/ui/app/components/pages/confirm-transaction-base/confirm-transaction-base.component.js
index 6bc415781..8d404aaca 100644
--- a/ui/app/components/pages/confirm-transaction-base/confirm-transaction-base.component.js
+++ b/ui/app/components/pages/confirm-transaction-base/confirm-transaction-base.component.js
@@ -11,6 +11,7 @@ import {
import { CONFIRMED_STATUS, DROPPED_STATUS } from '../../../constants/transactions'
import UserPreferencedCurrencyDisplay from '../../user-preferenced-currency-display'
import { PRIMARY, SECONDARY } from '../../../constants/common'
+import AdvancedGasInputs from '../../gas-customization/advanced-gas-inputs'
export default class ConfirmTransactionBase extends Component {
static contextTypes = {
@@ -81,6 +82,11 @@ export default class ConfirmTransactionBase extends Component {
titleComponent: PropTypes.node,
valid: PropTypes.bool,
warning: PropTypes.string,
+ advancedInlineGasShown: PropTypes.bool,
+ gasPrice: PropTypes.number,
+ gasLimit: PropTypes.number,
+ insufficientBalance: PropTypes.bool,
+ convertThenUpdateGasAndCalculate: PropTypes.func,
}
state = {
@@ -165,6 +171,11 @@ export default class ConfirmTransactionBase extends Component {
hexTransactionFee,
hexTransactionTotal,
hideDetails,
+ advancedInlineGasShown,
+ gasPrice,
+ gasLimit,
+ insufficientBalance,
+ convertThenUpdateGasAndCalculate,
} = this.props
if (hideDetails) {
@@ -182,6 +193,18 @@ export default class ConfirmTransactionBase extends Component {
headerTextClassName="confirm-detail-row__header-text--edit"
onHeaderClick={() => this.handleEditGas()}
/>
+ {advancedInlineGasShown
+ ? <AdvancedGasInputs
+ updateCustomGasPrice={newGasPrice => convertThenUpdateGasAndCalculate({ gasPrice: newGasPrice, gasLimit })}
+ updateCustomGasLimit={newGasLimit => convertThenUpdateGasAndCalculate({ gasLimit: newGasLimit, gasPrice })}
+ customGasPrice={gasPrice}
+ customGasLimit={gasLimit}
+ insufficientBalance={insufficientBalance}
+ customPriceIsSafe={true}
+ isSpeedUp={false}
+ />
+ : null
+ }
</div>
<div>
<ConfirmDetailRow