aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/gas-customization/gas-modal-page-container
diff options
context:
space:
mode:
Diffstat (limited to 'ui/app/components/gas-customization/gas-modal-page-container')
-rw-r--r--ui/app/components/gas-customization/gas-modal-page-container/advanced-tab-content/advanced-tab-content.component.js14
-rw-r--r--ui/app/components/gas-customization/gas-modal-page-container/advanced-tab-content/tests/advanced-tab-content-component.test.js6
-rw-r--r--ui/app/components/gas-customization/gas-modal-page-container/basic-tab-content/basic-tab-content.component.js7
-rw-r--r--ui/app/components/gas-customization/gas-modal-page-container/basic-tab-content/tests/basic-tab-content-component.test.js2
4 files changed, 16 insertions, 13 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 7c3142d0d..ba28ba63d 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
@@ -40,19 +40,20 @@ export default class AdvancedTabContent extends Component {
}
gasInputError ({ labelKey, insufficientBalance, customPriceIsSafe, isSpeedUp, value }) {
+ const { t } = this.context
let errorText
let errorType
let isInError = true
if (insufficientBalance) {
- errorText = 'Insufficient Balance'
+ errorText = t('insufficientBalance')
errorType = 'error'
} else if (labelKey === 'gasPrice' && isSpeedUp && value === 0) {
- errorText = 'Zero gas price on speed up'
+ errorText = t('zeroGasPriceOnSpeedUpError')
errorType = 'error'
} else if (labelKey === 'gasPrice' && !customPriceIsSafe) {
- errorText = 'Gas Price Extremely Low'
+ errorText = t('gasPriceExtremelyLow')
errorType = 'warning'
} else {
isInError = false
@@ -164,6 +165,7 @@ export default class AdvancedTabContent extends Component {
}
render () {
+ const { t } = this.context
const {
updateCustomGasPrice,
updateCustomGasLimit,
@@ -191,14 +193,14 @@ export default class AdvancedTabContent extends Component {
customPriceIsSafe,
isSpeedUp,
}) }
- <div className="advanced-tab__fee-chart__title">Live Gas Price Predictions</div>
+ <div className="advanced-tab__fee-chart__title">{ t('liveGasPricePredictions') }</div>
{!gasEstimatesLoading
? <GasPriceChart {...gasChartProps} updateCustomGasPrice={updateCustomGasPrice} />
: <Loading />
}
<div className="advanced-tab__fee-chart__speed-buttons">
- <span>Slower</span>
- <span>Faster</span>
+ <span>{ t('slower') }</span>
+ <span>{ t('faster') }</span>
</div>
</div>
</div>
diff --git a/ui/app/components/gas-customization/gas-modal-page-container/advanced-tab-content/tests/advanced-tab-content-component.test.js b/ui/app/components/gas-customization/gas-modal-page-container/advanced-tab-content/tests/advanced-tab-content-component.test.js
index 00242e430..932be6290 100644
--- a/ui/app/components/gas-customization/gas-modal-page-container/advanced-tab-content/tests/advanced-tab-content-component.test.js
+++ b/ui/app/components/gas-customization/gas-modal-page-container/advanced-tab-content/tests/advanced-tab-content-component.test.js
@@ -315,7 +315,7 @@ describe('AdvancedTabContent Component', function () {
})
assert.deepEqual(gasInputError, {
isInError: true,
- errorText: 'Insufficient Balance',
+ errorText: 'insufficientBalance',
errorType: 'error',
})
})
@@ -330,7 +330,7 @@ describe('AdvancedTabContent Component', function () {
})
assert.deepEqual(gasInputError, {
isInError: true,
- errorText: 'Zero gas price on speed up',
+ errorText: 'zeroGasPriceOnSpeedUpError',
errorType: 'error',
})
})
@@ -345,7 +345,7 @@ describe('AdvancedTabContent Component', function () {
})
assert.deepEqual(gasInputError, {
isInError: true,
- errorText: 'Gas Price Extremely Low',
+ errorText: 'gasPriceExtremelyLow',
errorType: 'warning',
})
})
diff --git a/ui/app/components/gas-customization/gas-modal-page-container/basic-tab-content/basic-tab-content.component.js b/ui/app/components/gas-customization/gas-modal-page-container/basic-tab-content/basic-tab-content.component.js
index 264d038da..05b8f700b 100644
--- a/ui/app/components/gas-customization/gas-modal-page-container/basic-tab-content/basic-tab-content.component.js
+++ b/ui/app/components/gas-customization/gas-modal-page-container/basic-tab-content/basic-tab-content.component.js
@@ -13,12 +13,13 @@ export default class BasicTabContent extends Component {
}
render () {
+ const { t } = this.context
const { gasPriceButtonGroupProps } = this.props
return (
<div className="basic-tab-content">
- <div className="basic-tab-content__title">Estimated Processing Times</div>
- <div className="basic-tab-content__blurb">Select a higher gas fee to accelerate the processing of your transaction.*</div>
+ <div className="basic-tab-content__title">{ t('estimatedProcessingTimes') }</div>
+ <div className="basic-tab-content__blurb">{ t('selectAHigherGasFee') }</div>
{!gasPriceButtonGroupProps.loading
? <GasPriceButtonGroup
className="gas-price-button-group--alt"
@@ -27,7 +28,7 @@ export default class BasicTabContent extends Component {
/>
: <Loading />
}
- <div className="basic-tab-content__footer-blurb">* Accelerating a transaction by using a higher gas price increases its chances of getting processed by the network faster, but it is not always guaranteed.</div>
+ <div className="basic-tab-content__footer-blurb">{ t('acceleratingATransaction') }</div>
</div>
)
}
diff --git a/ui/app/components/gas-customization/gas-modal-page-container/basic-tab-content/tests/basic-tab-content-component.test.js b/ui/app/components/gas-customization/gas-modal-page-container/basic-tab-content/tests/basic-tab-content-component.test.js
index 25abdd997..47864fcab 100644
--- a/ui/app/components/gas-customization/gas-modal-page-container/basic-tab-content/tests/basic-tab-content-component.test.js
+++ b/ui/app/components/gas-customization/gas-modal-page-container/basic-tab-content/tests/basic-tab-content-component.test.js
@@ -1,6 +1,6 @@
import React from 'react'
import assert from 'assert'
-import { shallow } from 'enzyme'
+import shallow from '../../../../../../lib/shallow-with-context'
import BasicTabContent from '../basic-tab-content.component'
import GasPriceButtonGroup from '../../../gas-price-button-group/'