Commit 3f9b436c authored by Matthew Spector's avatar Matthew Spector Committed by GitHub

fix: Changing some language around fees (#7492)

* fix: Changing some language around fees

* adding chain name to toolti

* lowercase network

* fixing tests
parent 40afc738
...@@ -4,6 +4,7 @@ import { AutoColumn } from 'components/Column' ...@@ -4,6 +4,7 @@ import { AutoColumn } from 'components/Column'
import UniswapXRouterLabel, { UniswapXGradient } from 'components/RouterLabel/UniswapXRouterLabel' import UniswapXRouterLabel, { UniswapXGradient } from 'components/RouterLabel/UniswapXRouterLabel'
import Row from 'components/Row' import Row from 'components/Row'
import { nativeOnChain } from 'constants/tokens' import { nativeOnChain } from 'constants/tokens'
import { chainIdToBackendName } from 'graphql/data/util'
import { ReactNode } from 'react' import { ReactNode } from 'react'
import { InterfaceTrade } from 'state/routing/types' import { InterfaceTrade } from 'state/routing/types'
import { isPreviewTrade, isUniswapXTrade } from 'state/routing/utils' import { isPreviewTrade, isUniswapXTrade } from 'state/routing/utils'
...@@ -43,7 +44,7 @@ export function GasBreakdownTooltip({ trade, hideUniswapXDescription }: GasBreak ...@@ -43,7 +44,7 @@ export function GasBreakdownTooltip({ trade, hideUniswapXDescription }: GasBreak
const inputCurrency = trade.inputAmount.currency const inputCurrency = trade.inputAmount.currency
const native = nativeOnChain(inputCurrency.chainId) const native = nativeOnChain(inputCurrency.chainId)
if (isPreviewTrade(trade)) return <NetworkFeesDescription native={native} /> if (isPreviewTrade(trade)) return <NetworkCostDescription native={native} />
const swapEstimate = !isUniswapX ? trade.gasUseEstimateUSD : undefined const swapEstimate = !isUniswapX ? trade.gasUseEstimateUSD : undefined
const approvalEstimate = trade.approveInfo.needsApprove ? trade.approveInfo.approveGasEstimateUSD : undefined const approvalEstimate = trade.approveInfo.needsApprove ? trade.approveInfo.approveGasEstimateUSD : undefined
...@@ -51,7 +52,7 @@ export function GasBreakdownTooltip({ trade, hideUniswapXDescription }: GasBreak ...@@ -51,7 +52,7 @@ export function GasBreakdownTooltip({ trade, hideUniswapXDescription }: GasBreak
const showEstimateDetails = Boolean(wrapEstimate || approvalEstimate) const showEstimateDetails = Boolean(wrapEstimate || approvalEstimate)
const description = const description =
isUniswapX && !hideUniswapXDescription ? <UniswapXDescription /> : <NetworkFeesDescription native={native} /> isUniswapX && !hideUniswapXDescription ? <UniswapXDescription /> : <NetworkCostDescription native={native} />
if (!showEstimateDetails) return description if (!showEstimateDetails) return description
...@@ -69,11 +70,13 @@ export function GasBreakdownTooltip({ trade, hideUniswapXDescription }: GasBreak ...@@ -69,11 +70,13 @@ export function GasBreakdownTooltip({ trade, hideUniswapXDescription }: GasBreak
) )
} }
function NetworkFeesDescription({ native }: { native: Currency }) { function NetworkCostDescription({ native }: { native: Currency }) {
const chainName = chainIdToBackendName(native.chainId)
return ( return (
<ThemedText.LabelMicro> <ThemedText.LabelMicro>
<Trans> <Trans>
The fee paid to the Ethereum network to process your transaction. This must be paid in {native.symbol}. Network cost is paid in {native.symbol} on the {chainName} network in order to transact.
</Trans>{' '} </Trans>{' '}
<ExternalLink href="https://support.uniswap.org/hc/en-us/articles/8370337377805-What-is-a-network-fee-"> <ExternalLink href="https://support.uniswap.org/hc/en-us/articles/8370337377805-What-is-a-network-fee-">
<Trans>Learn more</Trans> <Trans>Learn more</Trans>
......
...@@ -80,13 +80,13 @@ function FOTTooltipContent() { ...@@ -80,13 +80,13 @@ function FOTTooltipContent() {
function SwapFeeTooltipContent({ hasFee }: { hasFee: boolean }) { function SwapFeeTooltipContent({ hasFee }: { hasFee: boolean }) {
const message = hasFee ? ( const message = hasFee ? (
<Trans> <Trans>
Fee is applied on a few token pairs to ensure the best experience with Uniswap. It is paid in the output token and This fee is applied on select token pairs to ensure the best experience with Uniswap. It is paid in the output
has already been factored into the quote. token and has already been factored into the quote.
</Trans> </Trans>
) : ( ) : (
<Trans> <Trans>
Fee is applied on a few token pairs to ensure the best experience with Uniswap. There is no fee associated with This fee is applied on select token pairs to ensure the best experience with Uniswap. There is no fee associated
this swap. with this swap.
</Trans> </Trans>
) )
return ( return (
......
...@@ -36,7 +36,7 @@ describe('SwapModalFooter.tsx', () => { ...@@ -36,7 +36,7 @@ describe('SwapModalFooter.tsx', () => {
) )
).toBeInTheDocument() ).toBeInTheDocument()
expect( expect(
screen.getByText('The fee paid to the Ethereum network to process your transaction. This must be paid in ETH.') screen.getByText('Network cost is paid in ETH on the ETHEREUM network in order to transact.')
).toBeInTheDocument() ).toBeInTheDocument()
expect(screen.getByText('The impact your trade has on the market price of this pool.')).toBeInTheDocument() expect(screen.getByText('The impact your trade has on the market price of this pool.')).toBeInTheDocument()
}) })
......
...@@ -246,7 +246,7 @@ exports[`SwapLineItem.tsx dutch order eth input 1`] = ` ...@@ -246,7 +246,7 @@ exports[`SwapLineItem.tsx dutch order eth input 1`] = `
<div <div
class="c10 css-1m65e73" class="c10 css-1m65e73"
> >
The fee paid to the Ethereum network to process your transaction. This must be paid in ETH. Network cost is paid in ETH on the ETHEREUM network in order to transact.
<a <a
class="c11" class="c11"
href="https://support.uniswap.org/hc/en-us/articles/8370337377805-What-is-a-network-fee-" href="https://support.uniswap.org/hc/en-us/articles/8370337377805-What-is-a-network-fee-"
...@@ -744,7 +744,7 @@ exports[`SwapLineItem.tsx dutch order eth input 1`] = ` ...@@ -744,7 +744,7 @@ exports[`SwapLineItem.tsx dutch order eth input 1`] = `
<div <div
class="c9 css-obwv3p" class="c9 css-obwv3p"
> >
Fee is applied on a few token pairs to ensure the best experience with Uniswap. There is no fee associated with this swap. This fee is applied on select token pairs to ensure the best experience with Uniswap. There is no fee associated with this swap.
<a <a
class="c10" class="c10"
href="https://support.uniswap.org/hc/en-us/articles/20131678274957" href="https://support.uniswap.org/hc/en-us/articles/20131678274957"
...@@ -1486,7 +1486,7 @@ exports[`SwapLineItem.tsx exact input 1`] = ` ...@@ -1486,7 +1486,7 @@ exports[`SwapLineItem.tsx exact input 1`] = `
<div <div
class="c10 css-1m65e73" class="c10 css-1m65e73"
> >
The fee paid to the Ethereum network to process your transaction. This must be paid in ETH. Network cost is paid in ETH on the ETHEREUM network in order to transact.
<a <a
class="c11" class="c11"
href="https://support.uniswap.org/hc/en-us/articles/8370337377805-What-is-a-network-fee-" href="https://support.uniswap.org/hc/en-us/articles/8370337377805-What-is-a-network-fee-"
...@@ -2157,7 +2157,7 @@ exports[`SwapLineItem.tsx exact input 1`] = ` ...@@ -2157,7 +2157,7 @@ exports[`SwapLineItem.tsx exact input 1`] = `
<div <div
class="c9 css-obwv3p" class="c9 css-obwv3p"
> >
Fee is applied on a few token pairs to ensure the best experience with Uniswap. There is no fee associated with this swap. This fee is applied on select token pairs to ensure the best experience with Uniswap. There is no fee associated with this swap.
<a <a
class="c10" class="c10"
href="https://support.uniswap.org/hc/en-us/articles/20131678274957" href="https://support.uniswap.org/hc/en-us/articles/20131678274957"
...@@ -3157,7 +3157,7 @@ exports[`SwapLineItem.tsx exact input api 1`] = ` ...@@ -3157,7 +3157,7 @@ exports[`SwapLineItem.tsx exact input api 1`] = `
<div <div
class="c10 css-1m65e73" class="c10 css-1m65e73"
> >
The fee paid to the Ethereum network to process your transaction. This must be paid in ETH. Network cost is paid in ETH on the ETHEREUM network in order to transact.
<a <a
class="c11" class="c11"
href="https://support.uniswap.org/hc/en-us/articles/8370337377805-What-is-a-network-fee-" href="https://support.uniswap.org/hc/en-us/articles/8370337377805-What-is-a-network-fee-"
...@@ -3828,7 +3828,7 @@ exports[`SwapLineItem.tsx exact input api 1`] = ` ...@@ -3828,7 +3828,7 @@ exports[`SwapLineItem.tsx exact input api 1`] = `
<div <div
class="c9 css-obwv3p" class="c9 css-obwv3p"
> >
Fee is applied on a few token pairs to ensure the best experience with Uniswap. There is no fee associated with this swap. This fee is applied on select token pairs to ensure the best experience with Uniswap. There is no fee associated with this swap.
<a <a
class="c10" class="c10"
href="https://support.uniswap.org/hc/en-us/articles/20131678274957" href="https://support.uniswap.org/hc/en-us/articles/20131678274957"
...@@ -4828,7 +4828,7 @@ exports[`SwapLineItem.tsx exact output 1`] = ` ...@@ -4828,7 +4828,7 @@ exports[`SwapLineItem.tsx exact output 1`] = `
<div <div
class="c10 css-1m65e73" class="c10 css-1m65e73"
> >
The fee paid to the Ethereum network to process your transaction. This must be paid in ETH. Network cost is paid in ETH on the ETHEREUM network in order to transact.
<a <a
class="c11" class="c11"
href="https://support.uniswap.org/hc/en-us/articles/8370337377805-What-is-a-network-fee-" href="https://support.uniswap.org/hc/en-us/articles/8370337377805-What-is-a-network-fee-"
...@@ -5499,7 +5499,7 @@ exports[`SwapLineItem.tsx exact output 1`] = ` ...@@ -5499,7 +5499,7 @@ exports[`SwapLineItem.tsx exact output 1`] = `
<div <div
class="c9 css-obwv3p" class="c9 css-obwv3p"
> >
Fee is applied on a few token pairs to ensure the best experience with Uniswap. There is no fee associated with this swap. This fee is applied on select token pairs to ensure the best experience with Uniswap. There is no fee associated with this swap.
<a <a
class="c10" class="c10"
href="https://support.uniswap.org/hc/en-us/articles/20131678274957" href="https://support.uniswap.org/hc/en-us/articles/20131678274957"
...@@ -6499,7 +6499,7 @@ exports[`SwapLineItem.tsx fee on buy 1`] = ` ...@@ -6499,7 +6499,7 @@ exports[`SwapLineItem.tsx fee on buy 1`] = `
<div <div
class="c10 css-1m65e73" class="c10 css-1m65e73"
> >
The fee paid to the Ethereum network to process your transaction. This must be paid in ETH. Network cost is paid in ETH on the ETHEREUM network in order to transact.
<a <a
class="c11" class="c11"
href="https://support.uniswap.org/hc/en-us/articles/8370337377805-What-is-a-network-fee-" href="https://support.uniswap.org/hc/en-us/articles/8370337377805-What-is-a-network-fee-"
...@@ -7378,7 +7378,7 @@ exports[`SwapLineItem.tsx fee on buy 1`] = ` ...@@ -7378,7 +7378,7 @@ exports[`SwapLineItem.tsx fee on buy 1`] = `
<div <div
class="c9 css-obwv3p" class="c9 css-obwv3p"
> >
Fee is applied on a few token pairs to ensure the best experience with Uniswap. There is no fee associated with this swap. This fee is applied on select token pairs to ensure the best experience with Uniswap. There is no fee associated with this swap.
<a <a
class="c10" class="c10"
href="https://support.uniswap.org/hc/en-us/articles/20131678274957" href="https://support.uniswap.org/hc/en-us/articles/20131678274957"
...@@ -8378,7 +8378,7 @@ exports[`SwapLineItem.tsx fee on sell 1`] = ` ...@@ -8378,7 +8378,7 @@ exports[`SwapLineItem.tsx fee on sell 1`] = `
<div <div
class="c10 css-1m65e73" class="c10 css-1m65e73"
> >
The fee paid to the Ethereum network to process your transaction. This must be paid in ETH. Network cost is paid in ETH on the ETHEREUM network in order to transact.
<a <a
class="c11" class="c11"
href="https://support.uniswap.org/hc/en-us/articles/8370337377805-What-is-a-network-fee-" href="https://support.uniswap.org/hc/en-us/articles/8370337377805-What-is-a-network-fee-"
...@@ -9257,7 +9257,7 @@ exports[`SwapLineItem.tsx fee on sell 1`] = ` ...@@ -9257,7 +9257,7 @@ exports[`SwapLineItem.tsx fee on sell 1`] = `
<div <div
class="c9 css-obwv3p" class="c9 css-obwv3p"
> >
Fee is applied on a few token pairs to ensure the best experience with Uniswap. There is no fee associated with this swap. This fee is applied on select token pairs to ensure the best experience with Uniswap. There is no fee associated with this swap.
<a <a
class="c10" class="c10"
href="https://support.uniswap.org/hc/en-us/articles/20131678274957" href="https://support.uniswap.org/hc/en-us/articles/20131678274957"
...@@ -10224,7 +10224,7 @@ exports[`SwapLineItem.tsx preview exact in 1`] = ` ...@@ -10224,7 +10224,7 @@ exports[`SwapLineItem.tsx preview exact in 1`] = `
<div <div
class="c10 css-1m65e73" class="c10 css-1m65e73"
> >
The fee paid to the Ethereum network to process your transaction. This must be paid in ETH. Network cost is paid in ETH on the ETHEREUM network in order to transact.
<a <a
class="c11" class="c11"
href="https://support.uniswap.org/hc/en-us/articles/8370337377805-What-is-a-network-fee-" href="https://support.uniswap.org/hc/en-us/articles/8370337377805-What-is-a-network-fee-"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment