Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
interface
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
LuckySwap
interface
Commits
28ea3908
Unverified
Commit
28ea3908
authored
Sep 07, 2023
by
cartcrom
Committed by
GitHub
Sep 07, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: gate FOT UI (#7272)
* fix: gate FOT UI in swap component * feat: help article
parent
4ba0d8ff
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
17 deletions
+24
-17
AdvancedSwapDetails.tsx
src/components/swap/AdvancedSwapDetails.tsx
+10
-5
SwapModalFooter.tsx
src/components/swap/SwapModalFooter.tsx
+10
-5
useRoutingAPIArguments.ts
src/lib/hooks/routing/useRoutingAPIArguments.ts
+0
-4
types.ts
src/state/routing/types.ts
+0
-1
hooks.tsx
src/state/swap/hooks.tsx
+4
-2
No files found.
src/components/swap/AdvancedSwapDetails.tsx
View file @
28ea3908
...
@@ -11,7 +11,7 @@ import { ClassicTrade, InterfaceTrade } from 'state/routing/types'
...
@@ -11,7 +11,7 @@ import { ClassicTrade, InterfaceTrade } from 'state/routing/types'
import
{
getTransactionCount
,
isClassicTrade
}
from
'
state/routing/utils
'
import
{
getTransactionCount
,
isClassicTrade
}
from
'
state/routing/utils
'
import
{
formatCurrencyAmount
,
formatNumber
,
formatPriceImpact
,
NumberType
}
from
'
utils/formatNumbers
'
import
{
formatCurrencyAmount
,
formatNumber
,
formatPriceImpact
,
NumberType
}
from
'
utils/formatNumbers
'
import
{
Separator
,
ThemedText
}
from
'
../../theme
'
import
{
ExternalLink
,
Separator
,
ThemedText
}
from
'
../../theme
'
import
Column
from
'
../Column
'
import
Column
from
'
../Column
'
import
RouterLabel
from
'
../RouterLabel
'
import
RouterLabel
from
'
../RouterLabel
'
import
{
RowBetween
,
RowFixed
}
from
'
../Row
'
import
{
RowBetween
,
RowFixed
}
from
'
../Row
'
...
@@ -192,10 +192,15 @@ function TokenTaxLineItem({ trade, type }: { trade: ClassicTrade; type: 'input'
...
@@ -192,10 +192,15 @@ function TokenTaxLineItem({ trade, type }: { trade: ClassicTrade; type: 'input'
<
RowBetween
>
<
RowBetween
>
<
MouseoverTooltip
<
MouseoverTooltip
text=
{
text=
{
<
Trans
>
<>
Some tokens take a fee when they are bought or sold, which is set by the token issuer. Uniswap does not
<
Trans
>
receive any of these fees.
Some tokens take a fee when they are bought or sold, which is set by the token issuer. Uniswap does not
</
Trans
>
receive any of these fees.
</
Trans
>
{
'
'
}
<
ExternalLink
href=
"https://support.uniswap.org/hc/en-us/articles/18673568523789-What-is-a-token-fee-"
>
Learn more
</
ExternalLink
>
</>
}
}
>
>
<
ThemedText
.
BodySmall
color=
"textSecondary"
>
{
`${currency.symbol} fee`
}
</
ThemedText
.
BodySmall
>
<
ThemedText
.
BodySmall
color=
"textSecondary"
>
{
`${currency.symbol} fee`
}
</
ThemedText
.
BodySmall
>
...
...
src/components/swap/SwapModalFooter.tsx
View file @
28ea3908
...
@@ -15,7 +15,7 @@ import { ClassicTrade, InterfaceTrade, RouterPreference } from 'state/routing/ty
...
@@ -15,7 +15,7 @@ import { ClassicTrade, InterfaceTrade, RouterPreference } from 'state/routing/ty
import
{
getTransactionCount
,
isClassicTrade
}
from
'
state/routing/utils
'
import
{
getTransactionCount
,
isClassicTrade
}
from
'
state/routing/utils
'
import
{
useRouterPreference
,
useUserSlippageTolerance
}
from
'
state/user/hooks
'
import
{
useRouterPreference
,
useUserSlippageTolerance
}
from
'
state/user/hooks
'
import
styled
,
{
DefaultTheme
,
useTheme
}
from
'
styled-components
'
import
styled
,
{
DefaultTheme
,
useTheme
}
from
'
styled-components
'
import
{
ThemedText
}
from
'
theme
'
import
{
ExternalLink
,
ThemedText
}
from
'
theme
'
import
{
formatNumber
,
formatPriceImpact
,
NumberType
}
from
'
utils/formatNumbers
'
import
{
formatNumber
,
formatPriceImpact
,
NumberType
}
from
'
utils/formatNumbers
'
import
{
formatTransactionAmount
,
priceToPreciseFloat
}
from
'
utils/formatNumbers
'
import
{
formatTransactionAmount
,
priceToPreciseFloat
}
from
'
utils/formatNumbers
'
import
getRoutingDiagramEntries
from
'
utils/getRoutingDiagramEntries
'
import
getRoutingDiagramEntries
from
'
utils/getRoutingDiagramEntries
'
...
@@ -232,10 +232,15 @@ function TokenTaxLineItem({ trade, type }: { trade: ClassicTrade; type: 'input'
...
@@ -232,10 +232,15 @@ function TokenTaxLineItem({ trade, type }: { trade: ClassicTrade; type: 'input'
<Row align="flex-start" justify="space-between" gap="sm">
<Row align="flex-start" justify="space-between" gap="sm">
<MouseoverTooltip
<MouseoverTooltip
text={
text={
<Trans>
<>
Some tokens take a fee when they are bought or sold, which is set by the token issuer. Uniswap does not
<Trans>
receive any of these fees.
Some tokens take a fee when they are bought or sold, which is set by the token issuer. Uniswap does not
</Trans>
receive any of these fees.
</Trans>{' '}
<ExternalLink href="https://support.uniswap.org/hc/en-us/articles/18673568523789-What-is-a-token-fee-">
Learn more
</ExternalLink>
</>
}
}
>
>
<Label cursor="help">{t`
$
{
currency
.
symbol
}
fee
`}</Label>
<Label cursor="help">{t`
$
{
currency
.
symbol
}
fee
`}</Label>
...
...
src/lib/hooks/routing/useRoutingAPIArguments.ts
View file @
28ea3908
import
{
SkipToken
,
skipToken
}
from
'
@reduxjs/toolkit/query/react
'
import
{
SkipToken
,
skipToken
}
from
'
@reduxjs/toolkit/query/react
'
import
{
Currency
,
CurrencyAmount
,
Percent
,
TradeType
}
from
'
@uniswap/sdk-core
'
import
{
Currency
,
CurrencyAmount
,
Percent
,
TradeType
}
from
'
@uniswap/sdk-core
'
import
{
useFotAdjustmentsEnabled
}
from
'
featureFlags/flags/fotAdjustments
'
import
{
useUniswapXEthOutputEnabled
}
from
'
featureFlags/flags/uniswapXEthOutput
'
import
{
useUniswapXEthOutputEnabled
}
from
'
featureFlags/flags/uniswapXEthOutput
'
import
{
useUniswapXExactOutputEnabled
}
from
'
featureFlags/flags/uniswapXExactOutput
'
import
{
useUniswapXExactOutputEnabled
}
from
'
featureFlags/flags/uniswapXExactOutput
'
import
{
useUniswapXSyntheticQuoteEnabled
}
from
'
featureFlags/flags/uniswapXUseSyntheticQuote
'
import
{
useUniswapXSyntheticQuoteEnabled
}
from
'
featureFlags/flags/uniswapXUseSyntheticQuote
'
...
@@ -37,7 +36,6 @@ export function useRoutingAPIArguments({
...
@@ -37,7 +36,6 @@ export function useRoutingAPIArguments({
const
userDisabledUniswapX
=
useUserDisabledUniswapX
()
const
userDisabledUniswapX
=
useUserDisabledUniswapX
()
const
uniswapXEthOutputEnabled
=
useUniswapXEthOutputEnabled
()
const
uniswapXEthOutputEnabled
=
useUniswapXEthOutputEnabled
()
const
uniswapXExactOutputEnabled
=
useUniswapXExactOutputEnabled
()
const
uniswapXExactOutputEnabled
=
useUniswapXExactOutputEnabled
()
const
fotAdjustmentsEnabled
=
useFotAdjustmentsEnabled
()
return
useMemo
(
return
useMemo
(
()
=>
()
=>
...
@@ -61,7 +59,6 @@ export function useRoutingAPIArguments({
...
@@ -61,7 +59,6 @@ export function useRoutingAPIArguments({
userDisabledUniswapX
,
userDisabledUniswapX
,
uniswapXEthOutputEnabled
,
uniswapXEthOutputEnabled
,
uniswapXExactOutputEnabled
,
uniswapXExactOutputEnabled
,
fotAdjustmentsEnabled
,
inputTax
,
inputTax
,
outputTax
,
outputTax
,
},
},
...
@@ -76,7 +73,6 @@ export function useRoutingAPIArguments({
...
@@ -76,7 +73,6 @@ export function useRoutingAPIArguments({
uniswapXForceSyntheticQuotes
,
uniswapXForceSyntheticQuotes
,
userDisabledUniswapX
,
userDisabledUniswapX
,
uniswapXEthOutputEnabled
,
uniswapXEthOutputEnabled
,
fotAdjustmentsEnabled
,
inputTax
,
inputTax
,
outputTax
,
outputTax
,
]
]
...
...
src/state/routing/types.ts
View file @
28ea3908
...
@@ -46,7 +46,6 @@ export interface GetQuoteArgs {
...
@@ -46,7 +46,6 @@ export interface GetQuoteArgs {
uniswapXEthOutputEnabled
:
boolean
uniswapXEthOutputEnabled
:
boolean
uniswapXExactOutputEnabled
:
boolean
uniswapXExactOutputEnabled
:
boolean
userDisabledUniswapX
:
boolean
userDisabledUniswapX
:
boolean
fotAdjustmentsEnabled
:
boolean
inputTax
:
Percent
inputTax
:
Percent
outputTax
:
Percent
outputTax
:
Percent
}
}
...
...
src/state/swap/hooks.tsx
View file @
28ea3908
import
{
Trans
}
from
'
@lingui/macro
'
import
{
Trans
}
from
'
@lingui/macro
'
import
{
ChainId
,
Currency
,
CurrencyAmount
,
Percent
,
TradeType
}
from
'
@uniswap/sdk-core
'
import
{
ChainId
,
Currency
,
CurrencyAmount
,
Percent
,
TradeType
}
from
'
@uniswap/sdk-core
'
import
{
useWeb3React
}
from
'
@web3-react/core
'
import
{
useWeb3React
}
from
'
@web3-react/core
'
import
{
useFotAdjustmentsEnabled
}
from
'
featureFlags/flags/fotAdjustments
'
import
useAutoSlippageTolerance
from
'
hooks/useAutoSlippageTolerance
'
import
useAutoSlippageTolerance
from
'
hooks/useAutoSlippageTolerance
'
import
{
useDebouncedTrade
}
from
'
hooks/useDebouncedTrade
'
import
{
useDebouncedTrade
}
from
'
hooks/useDebouncedTrade
'
import
{
useSwapTaxes
}
from
'
hooks/useSwapTaxes
'
import
{
useSwapTaxes
}
from
'
hooks/useSwapTaxes
'
...
@@ -108,9 +109,10 @@ export function useDerivedSwapInfo(state: SwapState, chainId: ChainId | undefine
...
@@ -108,9 +109,10 @@ export function useDerivedSwapInfo(state: SwapState, chainId: ChainId | undefine
const
inputCurrency
=
useCurrency
(
inputCurrencyId
,
chainId
)
const
inputCurrency
=
useCurrency
(
inputCurrencyId
,
chainId
)
const
outputCurrency
=
useCurrency
(
outputCurrencyId
,
chainId
)
const
outputCurrency
=
useCurrency
(
outputCurrencyId
,
chainId
)
const
fotAdjustmentsEnabled
=
useFotAdjustmentsEnabled
()
const
{
inputTax
,
outputTax
}
=
useSwapTaxes
(
const
{
inputTax
,
outputTax
}
=
useSwapTaxes
(
inputCurrency
?.
isToken
?
inputCurrency
.
address
:
undefined
,
inputCurrency
?.
isToken
&&
fotAdjustmentsEnabled
?
inputCurrency
.
address
:
undefined
,
outputCurrency
?.
isToken
?
outputCurrency
.
address
:
undefined
outputCurrency
?.
isToken
&&
fotAdjustmentsEnabled
?
outputCurrency
.
address
:
undefined
)
)
const
recipientLookup
=
useENS
(
recipient
??
undefined
)
const
recipientLookup
=
useENS
(
recipient
??
undefined
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment