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
1882b146
Unverified
Commit
1882b146
authored
Oct 11, 2023
by
eddie
Committed by
GitHub
Oct 11, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: hide slippage warning when trade is x (#7439)
parent
d56030a9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
4 deletions
+13
-4
index.tsx
src/components/Settings/MenuButton/index.tsx
+7
-3
index.tsx
src/components/Settings/index.tsx
+6
-1
No files found.
src/components/Settings/MenuButton/index.tsx
View file @
1882b146
import
{
t
,
Trans
}
from
'
@lingui/macro
'
import
{
t
,
Trans
}
from
'
@lingui/macro
'
import
{
Settings
}
from
'
components/Icons/Settings
'
import
{
Settings
}
from
'
components/Icons/Settings
'
import
Row
from
'
components/Row
'
import
Row
from
'
components/Row
'
import
{
InterfaceTrade
}
from
'
state/routing/types
'
import
{
isUniswapXTrade
}
from
'
state/routing/utils
'
import
{
useUserSlippageTolerance
}
from
'
state/user/hooks
'
import
{
useUserSlippageTolerance
}
from
'
state/user/hooks
'
import
{
SlippageTolerance
}
from
'
state/user/types
'
import
{
SlippageTolerance
}
from
'
state/user/types
'
import
styled
from
'
styled-components
'
import
styled
from
'
styled-components
'
...
@@ -45,11 +47,11 @@ const IconContainerWithSlippage = styled(IconContainer)<{ displayWarning?: boole
...
@@ -45,11 +47,11 @@ const IconContainerWithSlippage = styled(IconContainer)<{ displayWarning?: boole
displayWarning
?
theme
.
deprecated_accentWarningSoft
:
theme
.
surface2
}
;
displayWarning
?
theme
.
deprecated_accentWarningSoft
:
theme
.
surface2
}
;
`
`
const
ButtonContent
=
()
=>
{
const
ButtonContent
=
(
{
trade
}:
{
trade
?:
InterfaceTrade
}
)
=>
{
const
[
userSlippageTolerance
]
=
useUserSlippageTolerance
()
const
[
userSlippageTolerance
]
=
useUserSlippageTolerance
()
const
{
formatSlippage
}
=
useFormatter
()
const
{
formatSlippage
}
=
useFormatter
()
if
(
userSlippageTolerance
===
SlippageTolerance
.
Auto
)
{
if
(
userSlippageTolerance
===
SlippageTolerance
.
Auto
||
isUniswapXTrade
(
trade
)
)
{
return
(
return
(
<
IconContainer
>
<
IconContainer
>
<
Icon
/>
<
Icon
/>
...
@@ -73,10 +75,12 @@ export default function MenuButton({
...
@@ -73,10 +75,12 @@ export default function MenuButton({
disabled
,
disabled
,
onClick
,
onClick
,
isActive
,
isActive
,
trade
,
}:
{
}:
{
disabled
:
boolean
disabled
:
boolean
onClick
:
()
=>
void
onClick
:
()
=>
void
isActive
:
boolean
isActive
:
boolean
trade
?:
InterfaceTrade
})
{
})
{
return
(
return
(
<
Button
<
Button
...
@@ -87,7 +91,7 @@ export default function MenuButton({
...
@@ -87,7 +91,7 @@ export default function MenuButton({
data
-
testid=
"open-settings-dialog-button"
data
-
testid=
"open-settings-dialog-button"
aria
-
label=
{
t
`Transaction Settings`
}
aria
-
label=
{
t
`Transaction Settings`
}
>
>
<
ButtonContent
/>
<
ButtonContent
trade=
{
trade
}
/>
</
Button
>
</
Button
>
)
)
}
}
src/components/Settings/index.tsx
View file @
1882b146
...
@@ -152,7 +152,12 @@ export default function SettingsTab({
...
@@ -152,7 +152,12 @@ export default function SettingsTab({
return
(
return
(
<
Menu
ref=
{
node
}
>
<
Menu
ref=
{
node
}
>
<
MenuButton
disabled=
{
!
isChainSupported
||
chainId
!==
connectedChainId
}
isActive=
{
isOpen
}
onClick=
{
toggleMenu
}
/>
<
MenuButton
disabled=
{
!
isChainSupported
||
chainId
!==
connectedChainId
}
isActive=
{
isOpen
}
onClick=
{
toggleMenu
}
trade=
{
trade
}
/>
{
isOpenDesktop
&&
<
MenuFlyout
>
{
Settings
}
</
MenuFlyout
>
}
{
isOpenDesktop
&&
<
MenuFlyout
>
{
Settings
}
</
MenuFlyout
>
}
{
isOpenMobile
&&
(
{
isOpenMobile
&&
(
<
Portal
>
<
Portal
>
...
...
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