aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/gas-customization/gas-modal-page-container
diff options
context:
space:
mode:
authorDan Miller <danjm.com@gmail.com>2018-09-13 20:35:17 +0800
committerDan Miller <danjm.com@gmail.com>2018-12-04 11:36:04 +0800
commitb567c78bcae73e9c73b69040d22e096e4f876a2b (patch)
tree0b8327736e09cd41ca978d82cd7c1108c23165a5 /ui/app/components/gas-customization/gas-modal-page-container
parent7de3f22d63748ed5a81e947755db056d4cdef3db (diff)
downloadtangerine-wallet-browser-b567c78bcae73e9c73b69040d22e096e4f876a2b.tar.gz
tangerine-wallet-browser-b567c78bcae73e9c73b69040d22e096e4f876a2b.tar.zst
tangerine-wallet-browser-b567c78bcae73e9c73b69040d22e096e4f876a2b.zip
Integrate gas buttons with the send screen.
Diffstat (limited to 'ui/app/components/gas-customization/gas-modal-page-container')
-rw-r--r--ui/app/components/gas-customization/gas-modal-page-container/gas-modal-page-container.component.js16
-rw-r--r--ui/app/components/gas-customization/gas-modal-page-container/gas-modal-page-container.container.js13
2 files changed, 22 insertions, 7 deletions
diff --git a/ui/app/components/gas-customization/gas-modal-page-container/gas-modal-page-container.component.js b/ui/app/components/gas-customization/gas-modal-page-container/gas-modal-page-container.component.js
index 89065472d..db730458d 100644
--- a/ui/app/components/gas-customization/gas-modal-page-container/gas-modal-page-container.component.js
+++ b/ui/app/components/gas-customization/gas-modal-page-container/gas-modal-page-container.component.js
@@ -89,16 +89,20 @@ export default class GasModalPageContainer extends Component {
},
{
gasPriceButtonGroupProps,
+ hideBasic,
...advancedTabProps
}) {
return (
<Tabs>
- <Tab name={this.context.t('basic')}>
- <div className="gas-modal-content">
- { this.renderBasicTabContent(gasPriceButtonGroupProps) }
- { this.renderInfoRows(originalTotalFiat, originalTotalEth, newTotalFiat, newTotalEth) }
- </div>
- </Tab>
+ {hideBasic
+ ? null
+ : <Tab name={this.context.t('basic')}>
+ <div className="gas-modal-content">
+ { this.renderBasicTabContent(gasPriceButtonGroupProps) }
+ { this.renderInfoRows(originalTotalFiat, originalTotalEth, newTotalFiat, newTotalEth) }
+ </div>
+ </Tab>
+ }
<Tab name={this.context.t('advanced')}>
<div className="gas-modal-content">
{ this.renderAdvancedTabContent(advancedTabProps) }
diff --git a/ui/app/components/gas-customization/gas-modal-page-container/gas-modal-page-container.container.js b/ui/app/components/gas-customization/gas-modal-page-container/gas-modal-page-container.container.js
index 7e2a7e144..a150e5009 100644
--- a/ui/app/components/gas-customization/gas-modal-page-container/gas-modal-page-container.container.js
+++ b/ui/app/components/gas-customization/gas-modal-page-container/gas-modal-page-container.container.js
@@ -11,6 +11,9 @@ import {
setCustomGasLimit,
} from '../../../ducks/gas.duck'
import {
+ hideGasButtonGroup,
+} from '../../../ducks/send.duck'
+import {
updateGasAndCalculate,
} from '../../../ducks/confirm-transaction.duck'
import {
@@ -59,7 +62,10 @@ const mapStateToProps = state => {
const newTotalFiat = addHexWEIsToRenderableFiat(value, customGasTotal, currentCurrency, conversionRate)
+ const hideBasic = state.appState.modal.modalState.props.hideBasic
+
return {
+ hideBasic,
isConfirm: isConfirm(state),
customGasPriceInHex,
customGasLimitInHex,
@@ -95,6 +101,7 @@ const mapDispatchToProps = dispatch => {
updateConfirmTxGasAndCalculate: (gasLimit, gasPrice) => {
return dispatch(updateGasAndCalculate({ gasLimit, gasPrice }))
},
+ hideGasButtonGroup: () => dispatch(hideGasButtonGroup()),
}
}
@@ -102,6 +109,7 @@ const mergeProps = (stateProps, dispatchProps, ownProps) => {
const { gasPriceButtonGroupProps, isConfirm } = stateProps
const {
updateCustomGasPrice: dispatchUpdateCustomGasPrice,
+ hideGasButtonGroup: dispatchHideGasButtonGroup,
setGasData: dispatchSetGasData,
updateConfirmTxGasAndCalculate: dispatchUpdateConfirmTxGasAndCalculate,
...otherDispatchProps
@@ -111,7 +119,10 @@ const mergeProps = (stateProps, dispatchProps, ownProps) => {
...stateProps,
...otherDispatchProps,
...ownProps,
- onSubmit: isConfirm ? dispatchUpdateConfirmTxGasAndCalculate : dispatchSetGasData,
+ onSubmit: isConfirm ? dispatchUpdateConfirmTxGasAndCalculate : (newLimit, newPrice) => {
+ dispatchSetGasData(newLimit, newPrice)
+ dispatchHideGasButtonGroup()
+ },
gasPriceButtonGroupProps: {
...gasPriceButtonGroupProps,
handleGasPriceSelection: dispatchUpdateCustomGasPrice,