diff options
author | Dan Miller <danjm.com@gmail.com> | 2018-10-24 01:10:27 +0800 |
---|---|---|
committer | Dan Miller <danjm.com@gmail.com> | 2018-12-04 11:36:05 +0800 |
commit | 6f0406125d9d656a4a9826b616f28ffda894ec8e (patch) | |
tree | 777819f0af71fa73d9895afb99e95c226e0e5765 /ui/app/components/gas-customization/gas-modal-page-container/gas-modal-page-container.container.js | |
parent | aa798cc54557f0740c3e9ab3f7bc85bccdc8abc3 (diff) | |
download | tangerine-wallet-browser-6f0406125d9d656a4a9826b616f28ffda894ec8e.tar.gz tangerine-wallet-browser-6f0406125d9d656a4a9826b616f28ffda894ec8e.tar.zst tangerine-wallet-browser-6f0406125d9d656a4a9826b616f28ffda894ec8e.zip |
Clean up gas chart code.
Diffstat (limited to 'ui/app/components/gas-customization/gas-modal-page-container/gas-modal-page-container.container.js')
-rw-r--r-- | ui/app/components/gas-customization/gas-modal-page-container/gas-modal-page-container.container.js | 11 |
1 files changed, 9 insertions, 2 deletions
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 3a62d21cc..67c1ff2e3 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 @@ -69,6 +69,10 @@ const mapStateToProps = state => { const customGasPrice = calcCustomGasPrice(customModalGasPriceInHex) + const priceAndTimeEstimates = state.gas.priceAndTimeEstimates + const gasPrices = priceAndTimeEstimates.map(({ gasprice }) => gasprice) + const estimatedTimes = priceAndTimeEstimates.map(({ expectedTime }) => expectedTime) + return { hideBasic, isConfirm: isConfirm(state), @@ -77,7 +81,7 @@ const mapStateToProps = state => { customGasPrice, customGasLimit: calcCustomGasLimit(customModalGasLimitInHex), newTotalFiat, - currentTimeEstimate: getRenderableTimeEstimate(customGasPrice, state.gas.priceAndTimeEstimates), + currentTimeEstimate: getRenderableTimeEstimate(customGasPrice, priceAndTimeEstimates), gasPriceButtonGroupProps: { buttonDataLoading, defaultActiveButtonIndex: getDefaultActiveButtonIndex(gasButtonInfo, customModalGasPriceInHex), @@ -85,7 +89,10 @@ const mapStateToProps = state => { }, gasChartProps: { currentPrice: customGasPrice, - priceAndTimeEstimates: state.gas.priceAndTimeEstimates, + gasPrices, + estimatedTimes, + gasPricesMax: gasPrices[gasPrices.length - 1] + 1, + estimatedTimesMax: estimatedTimes[0], }, infoRowProps: { originalTotalFiat: addHexWEIsToRenderableFiat(value, gasTotal, currentCurrency, conversionRate), |