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
f9aadbbb
Unverified
Commit
f9aadbbb
authored
Oct 17, 2022
by
vignesh mohankumar
Committed by
GitHub
Oct 17, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: remove tokenSafety flag (#4944)
parent
f8c05255
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
24 deletions
+5
-24
index.tsx
src/components/SearchModal/CurrencyList/index.tsx
+1
-3
CurrencySearchModal.tsx
src/components/SearchModal/CurrencySearchModal.tsx
+4
-14
tokenSafety.ts
src/featureFlags/flags/tokenSafety.ts
+0
-7
No files found.
src/components/SearchModal/CurrencyList/index.tsx
View file @
f9aadbbb
...
...
@@ -6,7 +6,6 @@ import { TraceEvent } from 'analytics/TraceEvent'
import
TokenSafetyIcon
from
'
components/TokenSafety/TokenSafetyIcon
'
import
{
checkWarning
}
from
'
constants/tokenSafety
'
import
{
RedesignVariant
,
useRedesignFlag
}
from
'
featureFlags/flags/redesign
'
import
{
TokenSafetyVariant
,
useTokenSafetyFlag
}
from
'
featureFlags/flags/tokenSafety
'
import
{
CSSProperties
,
MutableRefObject
,
useCallback
,
useMemo
}
from
'
react
'
import
{
XOctagon
}
from
'
react-feather
'
import
{
Check
}
from
'
react-feather
'
...
...
@@ -135,7 +134,6 @@ export function CurrencyRow({
const
balance
=
useCurrencyBalance
(
account
??
undefined
,
currency
)
const
warning
=
currency
.
isNative
?
null
:
checkWarning
(
currency
.
address
)
const
redesignFlagEnabled
=
useRedesignFlag
()
===
RedesignVariant
.
Enabled
const
tokenSafetyFlagEnabled
=
useTokenSafetyFlag
()
===
TokenSafetyVariant
.
Enabled
const
isBlockedToken
=
!!
warning
&&
!
warning
.
canProceed
const
blockedTokenOpacity
=
'
0.6
'
...
...
@@ -168,7 +166,7 @@ export function CurrencyRow({
<
AutoColumn
style=
{
{
opacity
:
isBlockedToken
?
blockedTokenOpacity
:
'
1
'
}
}
>
<
Row
>
<
CurrencyName
title=
{
currency
.
name
}
>
{
currency
.
name
}
</
CurrencyName
>
{
tokenSafetyFlagEnabled
&&
<
TokenSafetyIcon
warning=
{
warning
}
/>
}
<
TokenSafetyIcon
warning=
{
warning
}
/>
{
isBlockedToken
&&
<
BlockedTokenIcon
/>
}
</
Row
>
<
ThemedText
.
DeprecatedDarkGray
ml=
"0px"
fontSize=
{
'
12px
'
}
fontWeight=
{
300
}
>
...
...
src/components/SearchModal/CurrencySearchModal.tsx
View file @
f9aadbbb
import
{
Currency
,
Token
}
from
'
@uniswap/sdk-core
'
import
{
TokenList
}
from
'
@uniswap/token-lists
'
import
TokenSafety
from
'
components/TokenSafety
'
import
{
TokenSafetyVariant
,
useTokenSafetyFlag
}
from
'
featureFlags/flags/tokenSafety
'
import
usePrevious
from
'
hooks/usePrevious
'
import
{
memo
,
useCallback
,
useEffect
,
useState
}
from
'
react
'
import
{
WrappedTokenInfo
}
from
'
state/lists/wrappedTokenInfo
'
...
...
@@ -59,23 +58,16 @@ export default memo(function CurrencySearchModal({
setModalView
(
CurrencyModalView
.
tokenSafety
)
}
const
tokenSafetyFlag
=
useTokenSafetyFlag
()
const
handleCurrencySelect
=
useCallback
(
(
currency
:
Currency
,
hasWarning
?:
boolean
)
=>
{
if
(
tokenSafetyFlag
===
TokenSafetyVariant
.
Enabled
&&
hasWarning
&&
currency
.
isToken
&&
!
userAddedTokens
.
find
((
token
)
=>
token
.
equals
(
currency
))
)
{
if
(
hasWarning
&&
currency
.
isToken
&&
!
userAddedTokens
.
find
((
token
)
=>
token
.
equals
(
currency
)))
{
showTokenSafetySpeedbump
(
currency
)
}
else
{
onCurrencySelect
(
currency
)
onDismiss
()
}
},
[
onDismiss
,
onCurrencySelect
,
tokenSafetyFlag
,
userAddedTokens
]
[
onDismiss
,
onCurrencySelect
,
userAddedTokens
]
)
// for token import view
...
...
@@ -121,7 +113,7 @@ export default memo(function CurrencySearchModal({
break
case
CurrencyModalView
.
tokenSafety
:
modalHeight
=
undefined
if
(
tokenSafetyFlag
===
TokenSafetyVariant
.
Enabled
&&
warningToken
)
{
if
(
warningToken
)
{
content
=
(
<
TokenSafety
tokenAddress=
{
warningToken
.
address
}
...
...
@@ -135,9 +127,7 @@ export default memo(function CurrencySearchModal({
case
CurrencyModalView
.
importToken
:
if
(
importToken
)
{
modalHeight
=
undefined
if
(
tokenSafetyFlag
===
TokenSafetyVariant
.
Enabled
)
{
showTokenSafetySpeedbump
(
importToken
)
}
content
=
(
<
ImportToken
tokens=
{
[
importToken
]
}
...
...
src/featureFlags/flags/tokenSafety.ts
deleted
100644 → 0
View file @
f8c05255
import
{
BaseVariant
}
from
'
../index
'
export
function
useTokenSafetyFlag
():
BaseVariant
{
return
BaseVariant
.
Enabled
}
export
{
BaseVariant
as
TokenSafetyVariant
}
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