aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components
diff options
context:
space:
mode:
Diffstat (limited to 'ui/app/components')
-rw-r--r--ui/app/components/app/gas-customization/gas-modal-page-container/advanced-tab-content/advanced-tab-content.component.js23
-rw-r--r--ui/app/components/app/gas-customization/gas-modal-page-container/advanced-tab-content/tests/advanced-tab-content-component.test.js13
-rw-r--r--ui/app/components/app/gas-customization/gas-modal-page-container/gas-modal-page-container.component.js2
-rw-r--r--ui/app/components/app/gas-customization/gas-modal-page-container/gas-modal-page-container.container.js10
-rw-r--r--ui/app/components/app/gas-customization/gas-modal-page-container/tests/gas-modal-page-container-container.test.js10
5 files changed, 38 insertions, 20 deletions
diff --git a/ui/app/components/app/gas-customization/gas-modal-page-container/advanced-tab-content/advanced-tab-content.component.js b/ui/app/components/app/gas-customization/gas-modal-page-container/advanced-tab-content/advanced-tab-content.component.js
index 7fbf8f0bd..ad8628621 100644
--- a/ui/app/components/app/gas-customization/gas-modal-page-container/advanced-tab-content/advanced-tab-content.component.js
+++ b/ui/app/components/app/gas-customization/gas-modal-page-container/advanced-tab-content/advanced-tab-content.component.js
@@ -23,6 +23,7 @@ export default class AdvancedTabContent extends Component {
insufficientBalance: PropTypes.bool,
customPriceIsSafe: PropTypes.bool,
isSpeedUp: PropTypes.bool,
+ isEthereumNetwork: PropTypes.bool,
}
constructor (props) {
@@ -188,6 +189,7 @@ export default class AdvancedTabContent extends Component {
customPriceIsSafe,
isSpeedUp,
transactionFee,
+ isEthereumNetwork,
} = this.props
return (
@@ -203,15 +205,20 @@ export default class AdvancedTabContent extends Component {
customPriceIsSafe,
isSpeedUp,
}) }
- <div className="advanced-tab__fee-chart__title">{ t('liveGasPricePredictions') }</div>
- {!gasEstimatesLoading
- ? <GasPriceChart {...gasChartProps} updateCustomGasPrice={updateCustomGasPrice} />
- : <Loading />
+ { isEthereumNetwork
+ ? <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>{ t('slower') }</span>
+ <span>{ t('faster') }</span>
+ </div>
+ </div>
+ : <div className="advanced-tab__fee-chart__title">{ t('chartOnlyAvailableEth') }</div>
}
- <div className="advanced-tab__fee-chart__speed-buttons">
- <span>{ t('slower') }</span>
- <span>{ t('faster') }</span>
- </div>
</div>
</div>
)
diff --git a/ui/app/components/app/gas-customization/gas-modal-page-container/advanced-tab-content/tests/advanced-tab-content-component.test.js b/ui/app/components/app/gas-customization/gas-modal-page-container/advanced-tab-content/tests/advanced-tab-content-component.test.js
index a6b81d2ce..5f7d90922 100644
--- a/ui/app/components/app/gas-customization/gas-modal-page-container/advanced-tab-content/tests/advanced-tab-content-component.test.js
+++ b/ui/app/components/app/gas-customization/gas-modal-page-container/advanced-tab-content/tests/advanced-tab-content-component.test.js
@@ -32,6 +32,7 @@ describe('AdvancedTabContent Component', function () {
insufficientBalance={false}
customPriceIsSafe={true}
isSpeedUp={false}
+ isEthereumNetwork={true}
/>, { context: { t: (str1, str2) => str2 ? str1 + str2 : str1 } })
})
@@ -59,9 +60,9 @@ describe('AdvancedTabContent Component', function () {
const feeChartDiv = advancedTabChildren.at(1)
assert(feeChartDiv.childAt(0).hasClass('advanced-tab__gas-edit-rows'))
- assert(feeChartDiv.childAt(1).hasClass('advanced-tab__fee-chart__title'))
- assert(feeChartDiv.childAt(2).is(GasPriceChart))
- assert(feeChartDiv.childAt(3).hasClass('advanced-tab__fee-chart__speed-buttons'))
+ assert(feeChartDiv.childAt(1).childAt(0).hasClass('advanced-tab__fee-chart__title'))
+ assert(feeChartDiv.childAt(1).childAt(1).is(GasPriceChart))
+ assert(feeChartDiv.childAt(1).childAt(2).hasClass('advanced-tab__fee-chart__speed-buttons'))
})
it('should render a loading component instead of the chart if gasEstimatesLoading is true', () => {
@@ -75,9 +76,9 @@ describe('AdvancedTabContent Component', function () {
const feeChartDiv = advancedTabChildren.at(1)
assert(feeChartDiv.childAt(0).hasClass('advanced-tab__gas-edit-rows'))
- assert(feeChartDiv.childAt(1).hasClass('advanced-tab__fee-chart__title'))
- assert(feeChartDiv.childAt(2).is(Loading))
- assert(feeChartDiv.childAt(3).hasClass('advanced-tab__fee-chart__speed-buttons'))
+ assert(feeChartDiv.childAt(1).childAt(0).hasClass('advanced-tab__fee-chart__title'))
+ assert(feeChartDiv.childAt(1).childAt(1).is(Loading))
+ assert(feeChartDiv.childAt(1).childAt(2).hasClass('advanced-tab__fee-chart__speed-buttons'))
})
it('should call renderDataSummary with the expected params', () => {
diff --git a/ui/app/components/app/gas-customization/gas-modal-page-container/gas-modal-page-container.component.js b/ui/app/components/app/gas-customization/gas-modal-page-container/gas-modal-page-container.component.js
index 76edbc334..d242f59f5 100644
--- a/ui/app/components/app/gas-customization/gas-modal-page-container/gas-modal-page-container.component.js
+++ b/ui/app/components/app/gas-customization/gas-modal-page-container/gas-modal-page-container.component.js
@@ -177,7 +177,7 @@ export default class GasModalPageContainer extends Component {
onSubmit(customModalGasLimitInHex, customModalGasPriceInHex)
}}
submitText={this.context.t('save')}
- headerCloseText={'Close'}
+ headerCloseText={this.context.t('close')}
hideCancel={true}
/>
</div>
diff --git a/ui/app/components/app/gas-customization/gas-modal-page-container/gas-modal-page-container.container.js b/ui/app/components/app/gas-customization/gas-modal-page-container/gas-modal-page-container.container.js
index cbc1e3e96..d541056f4 100644
--- a/ui/app/components/app/gas-customization/gas-modal-page-container/gas-modal-page-container.container.js
+++ b/ui/app/components/app/gas-customization/gas-modal-page-container/gas-modal-page-container.container.js
@@ -23,10 +23,13 @@ import {
updateGasAndCalculate,
} from '../../../../ducks/confirm-transaction/confirm-transaction.duck'
import {
- getCurrentCurrency,
conversionRateSelector as getConversionRate,
- getSelectedToken,
+ getCurrentCurrency,
getCurrentEthBalance,
+ getIsMainnet,
+ getSelectedToken,
+ isEthereumNetwork,
+ preferencesSelector,
} from '../../../../selectors/selectors.js'
import {
formatTimeEstimate,
@@ -63,7 +66,6 @@ import {
} from '../../send/send.utils'
import { addHexPrefix } from 'ethereumjs-util'
import { getAdjacentGasPrices, extrapolateY } from '../gas-price-chart/gas-price-chart.utils'
-import {getIsMainnet, preferencesSelector} from '../../../../selectors/selectors'
const mapStateToProps = (state, ownProps) => {
const { transaction = {} } = ownProps
@@ -138,6 +140,8 @@ const mapStateToProps = (state, ownProps) => {
txId: transaction.id,
insufficientBalance,
gasEstimatesLoading,
+ isMainnet,
+ isEthereumNetwork: isEthereumNetwork(state),
}
}
diff --git a/ui/app/components/app/gas-customization/gas-modal-page-container/tests/gas-modal-page-container-container.test.js b/ui/app/components/app/gas-customization/gas-modal-page-container/tests/gas-modal-page-container-container.test.js
index aaa4f1c41..b9eb67d2b 100644
--- a/ui/app/components/app/gas-customization/gas-modal-page-container/tests/gas-modal-page-container-container.test.js
+++ b/ui/app/components/app/gas-customization/gas-modal-page-container/tests/gas-modal-page-container-container.test.js
@@ -118,7 +118,7 @@ describe('gas-modal-page-container container', () => {
gasChartProps: {
'currentPrice': 4.294967295,
estimatedTimes: [31, 62, 93, 124],
- estimatedTimesMax: '31',
+ estimatedTimesMax: 31,
gasPrices: [3, 4, 5, 6],
gasPricesMax: 6,
},
@@ -140,6 +140,8 @@ describe('gas-modal-page-container container', () => {
insufficientBalance: true,
isSpeedUp: false,
txId: 34,
+ isEthereumNetwork: false,
+ isMainnet: true,
}
const baseMockOwnProps = { transaction: { id: 34 } }
const tests = [
@@ -179,6 +181,7 @@ describe('gas-modal-page-container container', () => {
...baseExpectedResult.infoRowProps,
newTotalFiat: '',
},
+ isMainnet: false,
},
},
{
@@ -196,7 +199,10 @@ describe('gas-modal-page-container container', () => {
},
}),
mockOwnProps: baseMockOwnProps,
- expectedResult: baseExpectedResult,
+ expectedResult: {
+ ...baseExpectedResult,
+ isMainnet: false,
+ },
},
{
mockState: Object.assign({}, baseMockState, {