aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/gas-customization/gas-modal-page-container/gas-modal-page-container.container.js
diff options
context:
space:
mode:
authorDan Miller <danjm.com@gmail.com>2018-08-16 20:28:27 +0800
committerDan Miller <danjm.com@gmail.com>2018-12-04 11:36:04 +0800
commit0a7dfcd55d02a7204d8f0773ff9d91f325aabea8 (patch)
treea4c7d3e219ca926f17f26d020fddc78854a23b53 /ui/app/components/gas-customization/gas-modal-page-container/gas-modal-page-container.container.js
parent112d18e316df312a648b8c8ac17c201314fc9ed6 (diff)
downloadtangerine-wallet-browser-0a7dfcd55d02a7204d8f0773ff9d91f325aabea8.tar
tangerine-wallet-browser-0a7dfcd55d02a7204d8f0773ff9d91f325aabea8.tar.gz
tangerine-wallet-browser-0a7dfcd55d02a7204d8f0773ff9d91f325aabea8.tar.bz2
tangerine-wallet-browser-0a7dfcd55d02a7204d8f0773ff9d91f325aabea8.tar.lz
tangerine-wallet-browser-0a7dfcd55d02a7204d8f0773ff9d91f325aabea8.tar.xz
tangerine-wallet-browser-0a7dfcd55d02a7204d8f0773ff9d91f325aabea8.tar.zst
tangerine-wallet-browser-0a7dfcd55d02a7204d8f0773ff9d91f325aabea8.zip
Connect the gas-button-group component to redux and a live api.
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.js39
1 files changed, 9 insertions, 30 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 2354d578c..ebdd035ea 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
@@ -4,45 +4,23 @@ import { hideModal } from '../../../actions'
import {
setCustomGasPrice,
setCustomGasLimit,
-} from '../../../ducks/custom-gas'
+} from '../../../ducks/gas.duck'
import {
getCustomGasPrice,
getCustomGasLimit,
+ getRenderableBasicEstimateData,
+ getBasicGasEstimateLoadingStatus,
} from '../../../selectors/custom-gas'
-const mockGasPriceButtonGroupProps = {
- buttonDataLoading: false,
- className: 'gas-price-button-group',
- gasButtonInfo: [
- {
- feeInPrimaryCurrency: '$0.52',
- feeInSecondaryCurrency: '0.0048 ETH',
- timeEstimate: '~ 1 min 0 sec',
- priceInHexWei: '0xa1b2c3f',
- },
- {
- feeInPrimaryCurrency: '$0.39',
- feeInSecondaryCurrency: '0.004 ETH',
- timeEstimate: '~ 1 min 30 sec',
- priceInHexWei: '0xa1b2c39',
- },
- {
- feeInPrimaryCurrency: '$0.30',
- feeInSecondaryCurrency: '0.00354 ETH',
- timeEstimate: '~ 2 min 1 sec',
- priceInHexWei: '0xa1b2c30',
- },
- ],
- handleGasPriceSelection: newPrice => console.log('NewPrice: ', newPrice),
- noButtonActiveByDefault: true,
- showCheck: true,
-}
-
const mapStateToProps = state => {
+ const buttonDataLoading = getBasicGasEstimateLoadingStatus(state)
return {
customGasPrice: getCustomGasPrice(state),
customGasLimit: getCustomGasLimit(state),
- gasPriceButtonGroupProps: mockGasPriceButtonGroupProps,
+ gasPriceButtonGroupProps: {
+ buttonDataLoading,
+ gasButtonInfo: getRenderableBasicEstimateData(state),
+ },
}
}
@@ -51,6 +29,7 @@ const mapDispatchToProps = dispatch => {
hideModal: () => dispatch(hideModal()),
updateCustomGasPrice: (newPrice) => dispatch(setCustomGasPrice(newPrice)),
updateCustomGasLimit: (newLimit) => dispatch(setCustomGasLimit(newLimit)),
+ handleGasPriceSelection: newPrice => console.log('NewPrice: ', newPrice),
}
}