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
a0e9211b
Unverified
Commit
a0e9211b
authored
Oct 19, 2022
by
vignesh mohankumar
Committed by
GitHub
Oct 19, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: remove redesign flag in settings (#4959)
chore: remove redesign flag in base settings
parent
aeeb3a24
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
39 deletions
+19
-39
index.tsx
src/components/QuestionHelper/index.tsx
+10
-14
index.tsx
src/components/TransactionSettings/index.tsx
+9
-25
No files found.
src/components/QuestionHelper/index.tsx
View file @
a0e9211b
import
{
RedesignVariant
,
useRedesignFlag
}
from
'
featureFlags/flags/redesign
'
import
{
ReactNode
,
useCallback
,
useState
}
from
'
react
'
import
{
ReactNode
,
useCallback
,
useState
}
from
'
react
'
import
{
HelpCircle
}
from
'
react-feather
'
import
{
HelpCircle
}
from
'
react-feather
'
import
styled
from
'
styled-components/macro
'
import
styled
from
'
styled-components/macro
'
import
Tooltip
from
'
../Tooltip
'
import
Tooltip
from
'
../Tooltip
'
const
QuestionWrapper
=
styled
.
div
<
{
redesignFlag
:
boolean
}
>
`
const
QuestionWrapper
=
styled
.
div
`
display: flex;
display: flex;
align-items: center;
align-items: center;
justify-content: center;
justify-content: center;
...
@@ -18,8 +17,7 @@ const QuestionWrapper = styled.div<{ redesignFlag: boolean }>`
...
@@ -18,8 +17,7 @@ const QuestionWrapper = styled.div<{ redesignFlag: boolean }>`
cursor: default;
cursor: default;
border-radius: 36px;
border-radius: 36px;
font-size: 12px;
font-size: 12px;
border-radius:
${({
redesignFlag
})
=>
redesignFlag
&&
'
12px
'
}
;
border-radius: 12px;
color:
${({
theme
,
redesignFlag
})
=>
!
redesignFlag
&&
theme
.
deprecated_text2
}
;
:hover,
:hover,
:focus {
:focus {
...
@@ -27,12 +25,12 @@ const QuestionWrapper = styled.div<{ redesignFlag: boolean }>`
...
@@ -27,12 +25,12 @@ const QuestionWrapper = styled.div<{ redesignFlag: boolean }>`
}
}
`
`
const
QuestionMark
=
styled
.
span
<
{
redesignFlag
?:
boolean
}
>
`
const
QuestionMark
=
styled
.
span
`
font-size: 14px;
font-size: 14px;
margin-left:
${({
redesignFlag
})
=>
redesignFlag
&&
'
8px
'
}
;
margin-left:
8px
;
align-items:
${({
redesignFlag
})
=>
redesignFlag
&&
'
center
'
}
;
align-items:
center
;
color:
${({
theme
,
redesignFlag
})
=>
redesignFlag
&&
theme
.
textSecondary
}
;
color:
${({
theme
})
=>
theme
.
textSecondary
}
;
margin-top:
${({
redesignFlag
})
=>
redesignFlag
&&
'
2.5px
'
}
;
margin-top:
2.5px
;
`
`
export
default
function
QuestionHelper
({
text
}:
{
text
:
ReactNode
;
size
?:
number
})
{
export
default
function
QuestionHelper
({
text
}:
{
text
:
ReactNode
;
size
?:
number
})
{
...
@@ -40,14 +38,12 @@ export default function QuestionHelper({ text }: { text: ReactNode; size?: numbe
...
@@ -40,14 +38,12 @@ export default function QuestionHelper({ text }: { text: ReactNode; size?: numbe
const
open
=
useCallback
(()
=>
setShow
(
true
),
[
setShow
])
const
open
=
useCallback
(()
=>
setShow
(
true
),
[
setShow
])
const
close
=
useCallback
(()
=>
setShow
(
false
),
[
setShow
])
const
close
=
useCallback
(()
=>
setShow
(
false
),
[
setShow
])
const
redesignFlag
=
useRedesignFlag
()
const
redesignFlagEnabled
=
redesignFlag
===
RedesignVariant
.
Enabled
return
(
return
(
<
span
style=
{
{
marginLeft
:
4
,
display
:
'
flex
'
,
alignItems
:
'
center
'
}
}
>
<
span
style=
{
{
marginLeft
:
4
,
display
:
'
flex
'
,
alignItems
:
'
center
'
}
}
>
<
Tooltip
text=
{
text
}
show=
{
show
}
>
<
Tooltip
text=
{
text
}
show=
{
show
}
>
<
QuestionWrapper
onClick=
{
open
}
onMouseEnter=
{
open
}
onMouseLeave=
{
close
}
redesignFlag=
{
redesignFlagEnabled
}
>
<
QuestionWrapper
onClick=
{
open
}
onMouseEnter=
{
open
}
onMouseLeave=
{
close
}
>
<
QuestionMark
redesignFlag=
{
redesignFlagEnabled
}
>
<
QuestionMark
>
{
redesignFlagEnabled
?
<
HelpCircle
size=
{
16
}
></
HelpCircle
>
:
'
?
'
}
<
HelpCircle
size=
{
16
}
/>
</
QuestionMark
>
</
QuestionMark
>
</
QuestionWrapper
>
</
QuestionWrapper
>
</
Tooltip
>
</
Tooltip
>
...
...
src/components/TransactionSettings/index.tsx
View file @
a0e9211b
...
@@ -3,7 +3,6 @@ import { Percent } from '@uniswap/sdk-core'
...
@@ -3,7 +3,6 @@ import { Percent } from '@uniswap/sdk-core'
import
{
useWeb3React
}
from
'
@web3-react/core
'
import
{
useWeb3React
}
from
'
@web3-react/core
'
import
{
L2_CHAIN_IDS
}
from
'
constants/chains
'
import
{
L2_CHAIN_IDS
}
from
'
constants/chains
'
import
{
DEFAULT_DEADLINE_FROM_NOW
}
from
'
constants/misc
'
import
{
DEFAULT_DEADLINE_FROM_NOW
}
from
'
constants/misc
'
import
{
RedesignVariant
,
useRedesignFlag
}
from
'
featureFlags/flags/redesign
'
import
ms
from
'
ms.macro
'
import
ms
from
'
ms.macro
'
import
{
darken
}
from
'
polished
'
import
{
darken
}
from
'
polished
'
import
{
useState
}
from
'
react
'
import
{
useState
}
from
'
react
'
...
@@ -42,9 +41,9 @@ const FancyButton = styled.button`
...
@@ -42,9 +41,9 @@ const FancyButton = styled.button`
}
}
`
`
const
Option
=
styled
(
FancyButton
)
<
{
active
:
boolean
;
redesignFlag
:
boolean
}
>
`
const
Option
=
styled
(
FancyButton
)
<
{
active
:
boolean
}
>
`
margin-right: 8px;
margin-right: 8px;
border-radius:
${({
redesignFlag
})
=>
redesignFlag
&&
'
12px
'
}
;
border-radius:
12px
;
:hover {
:hover {
cursor: pointer;
cursor: pointer;
}
}
...
@@ -52,10 +51,10 @@ const Option = styled(FancyButton)<{ active: boolean; redesignFlag: boolean }>`
...
@@ -52,10 +51,10 @@ const Option = styled(FancyButton)<{ active: boolean; redesignFlag: boolean }>`
color:
${({
active
,
theme
})
=>
(
active
?
theme
.
deprecated_white
:
theme
.
deprecated_text1
)}
;
color:
${({
active
,
theme
})
=>
(
active
?
theme
.
deprecated_white
:
theme
.
deprecated_text1
)}
;
`
`
const
Input
=
styled
.
input
<
{
redesignFlag
:
boolean
}
>
`
const
Input
=
styled
.
input
`
background:
${({
theme
})
=>
theme
.
deprecated_bg1
}
;
background:
${({
theme
})
=>
theme
.
deprecated_bg1
}
;
font-size: 16px;
font-size: 16px;
border-radius:
${({
redesignFlag
})
=>
redesignFlag
&&
'
12px
'
}
;
border-radius:
12px
;
width: auto;
width: auto;
outline: none;
outline: none;
&::-webkit-outer-spin-button,
&::-webkit-outer-spin-button,
...
@@ -66,15 +65,15 @@ const Input = styled.input<{ redesignFlag: boolean }>`
...
@@ -66,15 +65,15 @@ const Input = styled.input<{ redesignFlag: boolean }>`
text-align: right;
text-align: right;
::placeholder {
::placeholder {
color:
${({
theme
,
redesignFlag
})
=>
redesignFlag
&&
theme
.
textTertiary
}
;
color:
${({
theme
})
=>
theme
.
textTertiary
}
;
}
}
`
`
const
OptionCustom
=
styled
(
FancyButton
)
<
{
active
?:
boolean
;
warning
?:
boolean
;
redesignFlag
:
boolean
}
>
`
const
OptionCustom
=
styled
(
FancyButton
)
<
{
active
?:
boolean
;
warning
?:
boolean
}
>
`
height: 2rem;
height: 2rem;
position: relative;
position: relative;
padding: 0 0.75rem;
padding: 0 0.75rem;
border-radius:
${({
redesignFlag
})
=>
redesignFlag
&&
'
12px
'
}
;
border-radius:
12px
;
flex: 1;
flex: 1;
border:
${({
theme
,
active
,
warning
})
=>
border:
${({
theme
,
active
,
warning
})
=>
active
active
...
@@ -109,8 +108,6 @@ const THREE_DAYS_IN_SECONDS = ms`3 days` / 1000
...
@@ -109,8 +108,6 @@ const THREE_DAYS_IN_SECONDS = ms`3 days` / 1000
export
default
function
TransactionSettings
({
placeholderSlippage
}:
TransactionSettingsProps
)
{
export
default
function
TransactionSettings
({
placeholderSlippage
}:
TransactionSettingsProps
)
{
const
{
chainId
}
=
useWeb3React
()
const
{
chainId
}
=
useWeb3React
()
const
theme
=
useTheme
()
const
theme
=
useTheme
()
const
redesignFlag
=
useRedesignFlag
()
const
redesignFlagEnabled
=
redesignFlag
===
RedesignVariant
.
Enabled
const
[
userSlippageTolerance
,
setUserSlippageTolerance
]
=
useUserSlippageTolerance
()
const
[
userSlippageTolerance
,
setUserSlippageTolerance
]
=
useUserSlippageTolerance
()
...
@@ -185,7 +182,6 @@ export default function TransactionSettings({ placeholderSlippage }: Transaction
...
@@ -185,7 +182,6 @@ export default function TransactionSettings({ placeholderSlippage }: Transaction
</
RowFixed
>
</
RowFixed
>
<
RowBetween
>
<
RowBetween
>
<
Option
<
Option
redesignFlag=
{
redesignFlagEnabled
}
onClick=
{
()
=>
{
onClick=
{
()
=>
{
parseSlippageInput
(
''
)
parseSlippageInput
(
''
)
}
}
}
}
...
@@ -193,12 +189,7 @@ export default function TransactionSettings({ placeholderSlippage }: Transaction
...
@@ -193,12 +189,7 @@ export default function TransactionSettings({ placeholderSlippage }: Transaction
>
>
<
Trans
>
Auto
</
Trans
>
<
Trans
>
Auto
</
Trans
>
</
Option
>
</
Option
>
<
OptionCustom
<
OptionCustom
active=
{
userSlippageTolerance
!==
'
auto
'
}
warning=
{
!!
slippageError
}
tabIndex=
{
-
1
}
>
redesignFlag=
{
redesignFlagEnabled
}
active=
{
userSlippageTolerance
!==
'
auto
'
}
warning=
{
!!
slippageError
}
tabIndex=
{
-
1
}
>
<
RowBetween
>
<
RowBetween
>
{
tooLow
||
tooHigh
?
(
{
tooLow
||
tooHigh
?
(
<
SlippageEmojiContainer
>
<
SlippageEmojiContainer
>
...
@@ -208,7 +199,6 @@ export default function TransactionSettings({ placeholderSlippage }: Transaction
...
@@ -208,7 +199,6 @@ export default function TransactionSettings({ placeholderSlippage }: Transaction
</
SlippageEmojiContainer
>
</
SlippageEmojiContainer
>
)
:
null
}
)
:
null
}
<
Input
<
Input
redesignFlag=
{
redesignFlagEnabled
}
placeholder=
{
placeholderSlippage
.
toFixed
(
2
)
}
placeholder=
{
placeholderSlippage
.
toFixed
(
2
)
}
value=
{
value=
{
slippageInput
.
length
>
0
slippageInput
.
length
>
0
...
@@ -258,14 +248,8 @@ export default function TransactionSettings({ placeholderSlippage }: Transaction
...
@@ -258,14 +248,8 @@ export default function TransactionSettings({ placeholderSlippage }: Transaction
/>
/>
</
RowFixed
>
</
RowFixed
>
<
RowFixed
>
<
RowFixed
>
<
OptionCustom
<
OptionCustom
style=
{
{
width
:
'
80px
'
}
}
warning=
{
!!
deadlineError
}
tabIndex=
{
-
1
}
>
style=
{
{
width
:
'
80px
'
}
}
warning=
{
!!
deadlineError
}
tabIndex=
{
-
1
}
redesignFlag=
{
redesignFlagEnabled
}
>
<
Input
<
Input
redesignFlag=
{
redesignFlagEnabled
}
placeholder=
{
(
DEFAULT_DEADLINE_FROM_NOW
/
60
).
toString
()
}
placeholder=
{
(
DEFAULT_DEADLINE_FROM_NOW
/
60
).
toString
()
}
value=
{
value=
{
deadlineInput
.
length
>
0
deadlineInput
.
length
>
0
...
...
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