aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/gas-customization/gas-modal-page-container/advanced-tab-content/advanced-tab-content.component.js
diff options
context:
space:
mode:
authorDan Miller <danjm.com@gmail.com>2018-08-08 21:51:06 +0800
committerDan Miller <danjm.com@gmail.com>2018-12-04 11:36:04 +0800
commit99c8804eeb8c3e407fa9f2d806c145113ec6ec2c (patch)
tree01c25072da3d50c46a8e6851342dfb6fe37be480 /ui/app/components/gas-customization/gas-modal-page-container/advanced-tab-content/advanced-tab-content.component.js
parent3b9ec8e1bc8f3db9cfd645b10e4908f06096c70c (diff)
downloadtangerine-wallet-browser-99c8804eeb8c3e407fa9f2d806c145113ec6ec2c.tar
tangerine-wallet-browser-99c8804eeb8c3e407fa9f2d806c145113ec6ec2c.tar.gz
tangerine-wallet-browser-99c8804eeb8c3e407fa9f2d806c145113ec6ec2c.tar.bz2
tangerine-wallet-browser-99c8804eeb8c3e407fa9f2d806c145113ec6ec2c.tar.lz
tangerine-wallet-browser-99c8804eeb8c3e407fa9f2d806c145113ec6ec2c.tar.xz
tangerine-wallet-browser-99c8804eeb8c3e407fa9f2d806c145113ec6ec2c.tar.zst
tangerine-wallet-browser-99c8804eeb8c3e407fa9f2d806c145113ec6ec2c.zip
Add tests for advanced-tab-component.js and subcomponents.
Diffstat (limited to 'ui/app/components/gas-customization/gas-modal-page-container/advanced-tab-content/advanced-tab-content.component.js')
-rw-r--r--ui/app/components/gas-customization/gas-modal-page-container/advanced-tab-content/advanced-tab-content.component.js30
1 files changed, 16 insertions, 14 deletions
diff --git a/ui/app/components/gas-customization/gas-modal-page-container/advanced-tab-content/advanced-tab-content.component.js b/ui/app/components/gas-customization/gas-modal-page-container/advanced-tab-content/advanced-tab-content.component.js
index a09869a46..69cd06cde 100644
--- a/ui/app/components/gas-customization/gas-modal-page-container/advanced-tab-content/advanced-tab-content.component.js
+++ b/ui/app/components/gas-customization/gas-modal-page-container/advanced-tab-content/advanced-tab-content.component.js
@@ -27,6 +27,8 @@ export default class AdvancedTabContent extends Component {
className="advanced-tab__gas-edit-row__input"
type="number"
value={value}
+ min={min}
+ precision={precision}
onChange={event => onChange(Number(event.target.value))}
/>
{showGWEI
@@ -59,23 +61,23 @@ export default class AdvancedTabContent extends Component {
)
}
+ renderGasEditRow (labelKey, ...gasInputArgs) {
+ return (
+ <div className="advanced-tab__gas-edit-row">
+ <div className="advanced-tab__gas-edit-row__label">
+ { this.context.t(labelKey) }
+ { this.infoButton(() => {}) }
+ </div>
+ { this.gasInput(...gasInputArgs) }
+ </div>
+ )
+ }
+
renderGasEditRows (customGasPrice, updateCustomGasPrice, customGasLimit, updateCustomGasLimit) {
return (
<div className="advanced-tab__gas-edit-rows">
- <div className="advanced-tab__gas-edit-row">
- <div className="advanced-tab__gas-edit-row__label">
- { this.context.t('gasPriceNoDenom') }
- { this.infoButton(() => {}) }
- </div>
- { this.gasInput(customGasPrice, updateCustomGasPrice, MIN_GAS_PRICE_DEC, 9, true) }
- </div>
- <div className="advanced-tab__gas-edit-row">
- <div className="advanced-tab__gas-edit-row__label">
- { this.context.t('gasLimit') }
- { this.infoButton(() => {}) }
- </div>
- { this.gasInput(customGasLimit, updateCustomGasLimit, MIN_GAS_LIMIT_DEC, 0) }
- </div>
+ { this.renderGasEditRow('gasPriceNoDenom', customGasPrice, updateCustomGasPrice, MIN_GAS_PRICE_DEC, 9, true) }
+ { this.renderGasEditRow('gasLimit', customGasLimit, updateCustomGasLimit, MIN_GAS_LIMIT_DEC, 0) }
</div>
)
}