1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-24 11:01:41 +01:00

Remove duplicate percent sign from MetaMask fee (#9647)

The MetaMask fee is shown with two percent signs on the view quote page, because the percent sign is embedded in the fee amount as well as in the localized message.

The fee amount used now comes from the API, and does not have a percent sign. The percent sign is now only in the localized message. This allows for different locales to display the percentage differently. The old hard-coded value with a percent sign embedded has been removed, as it is no longer used anywhere.
This commit is contained in:
Mark Stacey 2020-10-19 20:58:48 -02:30
parent d684c1b2e3
commit ff1e134ac9
2 changed files with 3 additions and 3 deletions

View File

@ -315,7 +315,6 @@ export function quotesToRenderableData (quotes, gasPrice, conversionRate, curren
conversionRate,
)
const metaMaskFee = `0.875%`
const slippageMultiplier = (new BigNumber(100 - slippage)).div(100)
const minimumAmountReceived = (new BigNumber(destinationValue)).times(slippageMultiplier).toFixed(6)
@ -348,7 +347,6 @@ export function quotesToRenderableData (quotes, gasPrice, conversionRate, curren
destinationTokenValue: formatSwapsValueForDisplay(destinationValue),
isBestQuote: quote.isBestQuote,
liquiditySourceKey,
metaMaskFee,
feeInEth,
detailedNetworkFees: `${feeInEth} (${feeInFiat})`,
networkFees: feeInFiat,

View File

@ -22,6 +22,7 @@ import {
getBalanceError,
getCustomSwapsGas,
getDestinationTokenInfo,
getMetaMaskFeeAmount,
getSwapsTradeTxParams,
getTopQuote,
navigateBackToBuildQuote,
@ -200,7 +201,6 @@ export default function ViewQuote () {
sourceTokenDecimals,
sourceTokenSymbol,
sourceTokenValue,
metaMaskFee,
} = renderableDataForUsedQuote
const { feeInFiat, feeInEth } = getRenderableGasFeesForQuote(
@ -341,6 +341,8 @@ export default function ViewQuote () {
}
}, [sourceTokenSymbol, sourceTokenValue, destinationTokenSymbol, destinationTokenValue, fetchParams, topQuote, numberOfQuotes, feeInFiat, bestQuoteReviewedEvent, anonymousBestQuoteReviewedEvent])
const metaMaskFee = useSelector(getMetaMaskFeeAmount)
const onFeeCardTokenApprovalClick = () => {
anonymousEditSpendLimitOpened()
editSpendLimitOpened()