mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Show transaction fee instead of total fee in top left of gas customization modal.
This commit is contained in:
parent
dabf263733
commit
66f7102c06
@ -17,7 +17,7 @@ export default class AdvancedTabContent extends Component {
|
||||
customGasLimit: PropTypes.number,
|
||||
gasEstimatesLoading: PropTypes.bool,
|
||||
millisecondsRemaining: PropTypes.number,
|
||||
totalFee: PropTypes.string,
|
||||
transactionFee: PropTypes.string,
|
||||
timeRemaining: PropTypes.string,
|
||||
gasChartProps: PropTypes.object,
|
||||
insufficientBalance: PropTypes.bool,
|
||||
@ -104,7 +104,7 @@ export default class AdvancedTabContent extends Component {
|
||||
return <i className="fa fa-info-circle" onClick={onClick} />
|
||||
}
|
||||
|
||||
renderDataSummary (totalFee, timeRemaining) {
|
||||
renderDataSummary (transactionFee, timeRemaining) {
|
||||
return (
|
||||
<div className="advanced-tab__transaction-data-summary">
|
||||
<div className="advanced-tab__transaction-data-summary__titles">
|
||||
@ -113,7 +113,7 @@ export default class AdvancedTabContent extends Component {
|
||||
</div>
|
||||
<div className="advanced-tab__transaction-data-summary__container">
|
||||
<div className="advanced-tab__transaction-data-summary__fee">
|
||||
{totalFee}
|
||||
{transactionFee}
|
||||
</div>
|
||||
<div className="time-remaining">{timeRemaining}</div>
|
||||
</div>
|
||||
@ -173,16 +173,16 @@ export default class AdvancedTabContent extends Component {
|
||||
customGasPrice,
|
||||
customGasLimit,
|
||||
insufficientBalance,
|
||||
totalFee,
|
||||
gasChartProps,
|
||||
gasEstimatesLoading,
|
||||
customPriceIsSafe,
|
||||
isSpeedUp,
|
||||
transactionFee,
|
||||
} = this.props
|
||||
|
||||
return (
|
||||
<div className="advanced-tab">
|
||||
{ this.renderDataSummary(totalFee, timeRemaining) }
|
||||
{ this.renderDataSummary(transactionFee, timeRemaining) }
|
||||
<div className="advanced-tab__fee-chart">
|
||||
{ this.renderGasEditRows({
|
||||
customGasPrice,
|
||||
|
@ -28,7 +28,7 @@ describe('AdvancedTabContent Component', function () {
|
||||
customGasPrice={11}
|
||||
customGasLimit={23456}
|
||||
timeRemaining={21500}
|
||||
totalFee={'$0.25'}
|
||||
transactionFee={'$0.25'}
|
||||
insufficientBalance={false}
|
||||
customPriceIsSafe={true}
|
||||
isSpeedUp={false}
|
||||
|
@ -74,8 +74,8 @@ export default class GasModalPageContainer extends Component {
|
||||
gasEstimatesLoading,
|
||||
customPriceIsSafe,
|
||||
isSpeedUp,
|
||||
transactionFee,
|
||||
}) {
|
||||
const { transactionFee } = this.props
|
||||
return (
|
||||
<AdvancedTabContent
|
||||
updateCustomGasPrice={convertThenUpdateCustomGasPrice}
|
||||
@ -133,7 +133,7 @@ export default class GasModalPageContainer extends Component {
|
||||
}) {
|
||||
let tabsToRender = [
|
||||
{ name: 'basic', content: this.renderBasicTabContent(gasPriceButtonGroupProps) },
|
||||
{ name: 'advanced', content: this.renderAdvancedTabContent(advancedTabProps) },
|
||||
{ name: 'advanced', content: this.renderAdvancedTabContent({ transactionFee, ...advancedTabProps }) },
|
||||
]
|
||||
|
||||
if (hideBasic) {
|
||||
|
@ -185,7 +185,7 @@ describe('GasModalPageContainer Component', function () {
|
||||
assert.equal(GP.renderAdvancedTabContent.callCount, 1)
|
||||
|
||||
assert.deepEqual(GP.renderBasicTabContent.getCall(0).args[0], mockGasPriceButtonGroupProps)
|
||||
assert.deepEqual(GP.renderAdvancedTabContent.getCall(0).args[0], { otherProps: 'mockAdvancedTabProps' })
|
||||
assert.deepEqual(GP.renderAdvancedTabContent.getCall(0).args[0], { transactionFee: 'mockTransactionFee', otherProps: 'mockAdvancedTabProps' })
|
||||
})
|
||||
|
||||
it('should call renderInfoRows with the expected props', () => {
|
||||
|
Loading…
Reference in New Issue
Block a user