aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/gas-customization/gas-price-button-group/gas-price-button-group.component.js
diff options
context:
space:
mode:
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.js27
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 3873f54bc..8d6675e18 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>
)
}
}