diff options
author | Dan Miller <danjm.com@gmail.com> | 2018-09-13 20:35:17 +0800 |
---|---|---|
committer | Dan Miller <danjm.com@gmail.com> | 2018-12-04 11:36:04 +0800 |
commit | b567c78bcae73e9c73b69040d22e096e4f876a2b (patch) | |
tree | 0b8327736e09cd41ca978d82cd7c1108c23165a5 /ui/app/components/gas-customization/gas-price-button-group/gas-price-button-group.component.js | |
parent | 7de3f22d63748ed5a81e947755db056d4cdef3db (diff) | |
download | dexon-wallet-b567c78bcae73e9c73b69040d22e096e4f876a2b.tar.gz dexon-wallet-b567c78bcae73e9c73b69040d22e096e4f876a2b.tar.zst dexon-wallet-b567c78bcae73e9c73b69040d22e096e4f876a2b.zip |
Integrate gas buttons with the send screen.
Diffstat (limited to 'ui/app/components/gas-customization/gas-price-button-group/gas-price-button-group.component.js')
-rw-r--r-- | ui/app/components/gas-customization/gas-price-button-group/gas-price-button-group.component.js | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/ui/app/components/gas-customization/gas-price-button-group/gas-price-button-group.component.js b/ui/app/components/gas-customization/gas-price-button-group/gas-price-button-group.component.js index 3873f54b..8d6675e1 100644 --- a/ui/app/components/gas-customization/gas-price-button-group/gas-price-button-group.component.js +++ b/ui/app/components/gas-customization/gas-price-button-group/gas-price-button-group.component.js @@ -27,7 +27,7 @@ export default class GasPriceButtonGroup extends Component { } renderButtonContent ({ - label, + labelKey, feeInPrimaryCurrency, feeInSecondaryCurrency, timeEstimate, @@ -36,7 +36,7 @@ export default class GasPriceButtonGroup extends Component { showCheck, }) { return (<div> - { label && <div className={`${className}__label`}>{ label }</div> } + { labelKey && <div className={`${className}__label`}>{ this.context.t(labelKey) }</div> } { feeInPrimaryCurrency && <div className={`${className}__primary-currency`}>{ feeInPrimaryCurrency }</div> } { feeInSecondaryCurrency && <div className={`${className}__secondary-currency`}>{ feeInSecondaryCurrency }</div> } { timeEstimate && <div className={`${className}__time-estimate`}>{ timeEstimate }</div> } @@ -57,9 +57,7 @@ export default class GasPriceButtonGroup extends Component { onClick={() => handleGasPriceSelection(priceInHexWei)} key={`gas-price-button-${index}`} > - {buttonDataLoading - ? 'Loading...' - : this.renderButtonContent(renderableGasInfo, buttonContentPropsAndFlags)} + {this.renderButtonContent(renderableGasInfo, buttonContentPropsAndFlags)} </Button> ) } @@ -68,18 +66,23 @@ export default class GasPriceButtonGroup extends Component { const { gasButtonInfo, defaultActiveButtonIndex = 1, + newActiveButtonIndex, noButtonActiveByDefault = false, + buttonDataLoading, ...buttonPropsAndFlags } = this.props return ( - <ButtonGroup - className={buttonPropsAndFlags.className} - defaultActiveButtonIndex={defaultActiveButtonIndex} - noButtonActiveByDefault={noButtonActiveByDefault} - > - { gasButtonInfo.map((obj, index) => this.renderButton(obj, buttonPropsAndFlags, index)) } - </ButtonGroup> + !buttonDataLoading + ? <ButtonGroup + className={buttonPropsAndFlags.className} + defaultActiveButtonIndex={defaultActiveButtonIndex} + newActiveButtonIndex={newActiveButtonIndex} + noButtonActiveByDefault={noButtonActiveByDefault} + > + { gasButtonInfo.map((obj, index) => this.renderButton(obj, buttonPropsAndFlags, index)) } + </ButtonGroup> + : <div className={`${buttonPropsAndFlags.className}__loading-container`}>Loading...</div> ) } } |