Add a minimumGasLimit to the gas customization modal in swaps (#9600)

* Add a minimumGasLimit to the gas customization modal in swaps

* Remove fallback object for modal props in swaps-gas-customization-modal.container.js
feature/default_network_editable
Dan J Miller 4 years ago committed by GitHub
parent 65fb18e1aa
commit 2540ca77b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      ui/app/pages/swaps/swaps-gas-customization-modal/swaps-gas-customization-modal.component.js
  2. 6
      ui/app/pages/swaps/swaps-gas-customization-modal/swaps-gas-customization-modal.container.js
  3. 1
      ui/app/pages/swaps/view-quote/view-quote.js

@ -41,6 +41,7 @@ export default class GasModalPageContainer extends Component {
setSwapsCustomizationModalPrice: PropTypes.func,
setSwapsCustomizationModalLimit: PropTypes.func,
gasEstimateLoadingHasFailed: PropTypes.bool,
minimumGasLimit: PropTypes.number.isRequired,
}
state = {
@ -79,6 +80,7 @@ export default class GasModalPageContainer extends Component {
setSwapsCustomizationModalLimit,
customGasPrice,
customGasLimit,
minimumGasLimit,
} = this.props
return (
@ -109,6 +111,7 @@ export default class GasModalPageContainer extends Component {
insufficientBalance={insufficientBalance}
customPriceIsSafe={!showCustomPriceTooLowWarning}
customGasLimitMessage={customGasLimitMessage}
minimumGasLimit={minimumGasLimit}
/>
</div>
</div>

@ -41,7 +41,8 @@ const mapStateToProps = (state) => {
extraInfoRow = null,
initialGasPrice,
initialGasLimit,
} = modalProps || {}
minimumGasLimit,
} = modalProps
const buttonDataLoading = swapGasPriceEstimateIsLoading(state)
const swapsCustomizationModalPrice = getSwapsCustomizationModalPrice(state)
@ -120,7 +121,8 @@ const mapStateToProps = (state) => {
customGasLimitMessage,
customTotalSupplement,
usdConversionRate: getUSDConversionRate(state),
disableSave: insufficientBalance,
disableSave: insufficientBalance || customGasLimit < minimumGasLimit,
minimumGasLimit,
}
}

@ -445,6 +445,7 @@ export default function ViewQuote() {
: null,
initialGasPrice: gasPrice,
initialGasLimit: maxGasLimit,
minimumGasLimit: nonCustomMaxGasLimit,
}),
)

Loading…
Cancel
Save