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
f2a33b6f
Unverified
Commit
f2a33b6f
authored
Oct 18, 2022
by
vignesh mohankumar
Committed by
GitHub
Oct 18, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: rm redesign flag in WalletModal (#4957)
parent
5462526f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
124 deletions
+39
-124
Option.tsx
src/components/WalletModal/Option.tsx
+26
-100
index.tsx
src/components/WalletModal/index.tsx
+13
-24
No files found.
src/components/WalletModal/Option.tsx
View file @
f2a33b6f
import
{
ElementName
,
Event
,
EventName
}
from
'
analytics/constants
'
import
{
ElementName
,
Event
,
EventName
}
from
'
analytics/constants
'
import
{
TraceEvent
}
from
'
analytics/TraceEvent
'
import
{
TraceEvent
}
from
'
analytics/TraceEvent
'
import
{
RedesignVariant
,
useRedesignFlag
}
from
'
featureFlags/flags/redesign
'
import
React
from
'
react
'
import
React
from
'
react
'
import
{
Check
}
from
'
react-feather
'
import
{
Check
}
from
'
react-feather
'
import
styled
from
'
styled-components/macro
'
import
styled
from
'
styled-components/macro
'
import
{
ExternalLink
}
from
'
../../theme
'
import
{
ExternalLink
}
from
'
../../theme
'
const
InfoCard
=
styled
.
button
<
{
isActive
?:
boolean
;
redesignFlag
?:
boolean
}
>
`
const
InfoCard
=
styled
.
button
<
{
isActive
?:
boolean
}
>
`
background-color:
${({
theme
,
isActive
,
redesignFlag
})
=>
background-color:
${({
theme
})
=>
theme
.
backgroundInteractive
}
;
redesignFlag
?
theme
.
backgroundInteractive
:
isActive
?
theme
.
deprecated_bg3
:
theme
.
deprecated_bg2
}
;
padding: 1rem;
padding: 1rem;
outline: none;
outline: none;
border: 1px solid;
border: 1px solid;
border-radius: 12px;
border-radius: 12px;
width: 100% !important;
width: 100% !important;
&:focus {
&:focus {
box-shadow:
${({
theme
,
redesignFlag
})
=>
!
redesignFlag
&&
`0 0 0 1px
${
theme
.
deprecated_primary1
}
`
}
;
background-color:
${({
theme
})
=>
theme
.
hoverState
}
;
background-color:
${({
theme
,
redesignFlag
})
=>
redesignFlag
&&
theme
.
hoverState
}
;
}
}
border-color:
${({
theme
,
isActive
,
redesignFlag
})
=>
border-color:
${({
theme
,
isActive
})
=>
(
isActive
?
theme
.
accentActive
:
'
transparent
'
)}
;
redesignFlag
?
(
isActive
?
theme
.
accentActive
:
'
transparent
'
)
:
isActive
?
'
transparent
'
:
theme
.
deprecated_bg3
}
;
`
`
const
CheckIcon
=
styled
(
Check
)
`
const
CheckIcon
=
styled
(
Check
)
`
...
@@ -53,48 +49,24 @@ const OptionCardLeft = styled.div`
...
@@ -53,48 +49,24 @@ const OptionCardLeft = styled.div`
const
OptionCardClickable
=
styled
(
OptionCard
as
any
)
<
{
const
OptionCardClickable
=
styled
(
OptionCard
as
any
)
<
{
active
?:
boolean
active
?:
boolean
clickable
?:
boolean
clickable
?:
boolean
redesignFlag
?:
boolean
}
>
`
}
>
`
margin-top: 0;
margin-top: 0;
border:
${({
active
,
theme
})
=>
active
&&
`1px solid
${
theme
.
accentActive
}
`
}
;
border:
${({
active
,
theme
})
=>
active
&&
`1px solid
${
theme
.
accentActive
}
`
}
;
&:hover {
&:hover {
cursor:
${({
clickable
})
=>
clickable
&&
'
pointer
'
}
;
cursor:
${({
clickable
})
=>
clickable
&&
'
pointer
'
}
;
background-color:
${({
theme
,
redesignFlag
})
=>
redesignFlag
&&
theme
.
hoverState
}
;
background-color:
${({
theme
})
=>
theme
.
hoverState
}
;
border:
${({
clickable
,
redesignFlag
,
theme
})
=>
clickable
&&
!
redesignFlag
&&
`1px solid
${
theme
.
deprecated_primary1
}
`
}
;
}
}
opacity:
${({
disabled
})
=>
(
disabled
?
'
0.5
'
:
'
1
'
)}
;
opacity:
${({
disabled
})
=>
(
disabled
?
'
0.5
'
:
'
1
'
)}
;
`
`
const
GreenCircle
=
styled
.
div
`
const
HeaderText
=
styled
.
div
`
${({
theme
})
=>
theme
.
flexRowNoWrap
}
justify-content: center;
align-items: center;
&:first-child {
height: 8px;
width: 8px;
margin-right: 8px;
background-color:
${({
theme
})
=>
theme
.
deprecated_green1
}
;
border-radius: 50%;
}
`
const
CircleWrapper
=
styled
.
div
`
color:
${({
theme
})
=>
theme
.
deprecated_green1
}
;
display: flex;
justify-content: center;
align-items: center;
`
const
HeaderText
=
styled
.
div
<
{
redesignFlag
?:
boolean
}
>
`
${({
theme
})
=>
theme
.
flexRowNoWrap
}
;
${({
theme
})
=>
theme
.
flexRowNoWrap
}
;
align-items: center;
align-items: center;
justify-content: center;
justify-content: center;
color:
${(
props
)
=>
color:
${(
props
)
=>
props
.
color
===
'
blue
'
?
({
theme
})
=>
theme
.
deprecated_primary1
:
({
theme
})
=>
theme
.
deprecated_text1
}
;
props
.
color
===
'
blue
'
?
({
theme
})
=>
theme
.
deprecated_primary1
:
({
theme
})
=>
theme
.
deprecated_text1
}
;
font-size:
${({
redesignFlag
})
=>
(
redesignFlag
?
'
16px
'
:
'
1rem
'
)}
;
font-size:
16px
;
font-weight:
${({
redesignFlag
})
=>
(
redesignFlag
?
'
600
'
:
'
500
'
)}
;
font-weight:
600
;
`
`
const
SubHeader
=
styled
.
div
`
const
SubHeader
=
styled
.
div
`
...
@@ -103,20 +75,6 @@ const SubHeader = styled.div`
...
@@ -103,20 +75,6 @@ const SubHeader = styled.div`
font-size: 12px;
font-size: 12px;
`
`
const
IconWrapperDeprecated
=
styled
.
div
<
{
size
?:
number
|
null
}
>
`
${({
theme
})
=>
theme
.
flexColumnNoWrap
}
;
align-items: center;
justify-content: center;
& > img,
span {
height:
${({
size
})
=>
(
size
?
size
+
'
px
'
:
'
24px
'
)}
;
width:
${({
size
})
=>
(
size
?
size
+
'
px
'
:
'
24px
'
)}
;
}
${({
theme
})
=>
theme
.
deprecated_mediaWidth
.
deprecated_upToMedium
`
align-items: flex-end;
`
}
;
`
const
IconWrapper
=
styled
.
div
<
{
size
?:
number
|
null
}
>
`
const
IconWrapper
=
styled
.
div
<
{
size
?:
number
|
null
}
>
`
${({
theme
})
=>
theme
.
flexColumnNoWrap
}
;
${({
theme
})
=>
theme
.
flexColumnNoWrap
}
;
align-items: center;
align-items: center;
...
@@ -155,9 +113,6 @@ export default function Option({
...
@@ -155,9 +113,6 @@ export default function Option({
isActive
?:
boolean
isActive
?:
boolean
id
:
string
id
:
string
})
{
})
{
const
redesignFlag
=
useRedesignFlag
()
const
redesignFlagEnabled
=
redesignFlag
===
RedesignVariant
.
Enabled
const
content
=
(
const
content
=
(
<
TraceEvent
<
TraceEvent
events=
{
[
Event
.
onClick
]
}
events=
{
[
Event
.
onClick
]
}
...
@@ -165,53 +120,24 @@ export default function Option({
...
@@ -165,53 +120,24 @@ export default function Option({
properties=
{
{
wallet_type
:
header
}
}
properties=
{
{
wallet_type
:
header
}
}
element=
{
ElementName
.
WALLET_TYPE_OPTION
}
element=
{
ElementName
.
WALLET_TYPE_OPTION
}
>
>
{
redesignFlagEnabled
?
(
<
OptionCardClickable
<
OptionCardClickable
id=
{
id
}
id=
{
id
}
onClick=
{
onClick
}
onClick=
{
onClick
}
clickable=
{
clickable
&&
!
isActive
}
clickable=
{
clickable
&&
!
isActive
}
active=
{
isActive
}
active=
{
isActive
}
data
-
testid=
"wallet-modal-option"
redesignFlag=
{
true
}
>
data
-
testid=
"wallet-modal-option"
<
OptionCardLeft
>
>
<
HeaderText
color=
{
color
}
>
<
OptionCardLeft
>
<
IconWrapper
size=
{
size
}
>
<
HeaderText
color=
{
color
}
redesignFlag=
{
true
}
>
<
img
src=
{
icon
}
alt=
{
'
Icon
'
}
/>
<
IconWrapper
size=
{
size
}
>
</
IconWrapper
>
<
img
src=
{
icon
}
alt=
{
'
Icon
'
}
/>
{
header
}
</
IconWrapper
>
</
HeaderText
>
{
header
}
{
subheader
&&
<
SubHeader
>
{
subheader
}
</
SubHeader
>
}
</
HeaderText
>
</
OptionCardLeft
>
{
subheader
&&
<
SubHeader
>
{
subheader
}
</
SubHeader
>
}
{
isActive
&&
<
CheckIcon
/>
}
</
OptionCardLeft
>
</
OptionCardClickable
>
{
isActive
&&
<
CheckIcon
/>
}
</
OptionCardClickable
>
)
:
(
<
OptionCardClickable
id=
{
id
}
onClick=
{
onClick
}
clickable=
{
clickable
&&
!
isActive
}
active=
{
isActive
}
redesignFlag=
{
false
}
data
-
testid=
"wallet-modal-option"
>
<
OptionCardLeft
>
<
HeaderText
color=
{
color
}
redesignFlag=
{
false
}
>
{
isActive
&&
(
<
CircleWrapper
>
<
GreenCircle
>
<
div
/>
</
GreenCircle
>
</
CircleWrapper
>
)
}
{
header
}
</
HeaderText
>
{
subheader
&&
<
SubHeader
>
{
subheader
}
</
SubHeader
>
}
</
OptionCardLeft
>
<
IconWrapperDeprecated
size=
{
size
}
>
<
img
src=
{
icon
}
alt=
{
'
Icon
'
}
/>
</
IconWrapperDeprecated
>
</
OptionCardClickable
>
)
}
</
TraceEvent
>
</
TraceEvent
>
)
)
if
(
link
)
{
if
(
link
)
{
...
...
src/components/WalletModal/index.tsx
View file @
f2a33b6f
...
@@ -8,7 +8,6 @@ import { AutoColumn } from 'components/Column'
...
@@ -8,7 +8,6 @@ import { AutoColumn } from 'components/Column'
import
{
AutoRow
}
from
'
components/Row
'
import
{
AutoRow
}
from
'
components/Row
'
import
{
getConnection
,
getConnectionName
,
getIsCoinbaseWallet
,
getIsInjected
,
getIsMetaMask
}
from
'
connection/utils
'
import
{
getConnection
,
getConnectionName
,
getIsCoinbaseWallet
,
getIsInjected
,
getIsMetaMask
}
from
'
connection/utils
'
import
{
NftVariant
,
useNftFlag
}
from
'
featureFlags/flags/nft
'
import
{
NftVariant
,
useNftFlag
}
from
'
featureFlags/flags/nft
'
import
{
RedesignVariant
,
useRedesignFlag
}
from
'
featureFlags/flags/redesign
'
import
usePrevious
from
'
hooks/usePrevious
'
import
usePrevious
from
'
hooks/usePrevious
'
import
{
useCallback
,
useEffect
,
useState
}
from
'
react
'
import
{
useCallback
,
useEffect
,
useState
}
from
'
react
'
import
{
ArrowLeft
}
from
'
react-feather
'
import
{
ArrowLeft
}
from
'
react-feather
'
...
@@ -47,30 +46,30 @@ const CloseColor = styled(Close)`
...
@@ -47,30 +46,30 @@ const CloseColor = styled(Close)`
}
}
`
`
const
Wrapper
=
styled
.
div
<
{
redesignFlag
?:
boolean
}
>
`
const
Wrapper
=
styled
.
div
`
${({
theme
})
=>
theme
.
flexColumnNoWrap
}
${({
theme
})
=>
theme
.
flexColumnNoWrap
}
background-color:
${({
redesignFlag
,
theme
})
=>
redesignFlag
&&
theme
.
backgroundSurface
}
;
background-color:
${({
theme
})
=>
theme
.
backgroundSurface
}
;
outline:
${({
theme
,
redesignFlag
})
=>
redesignFlag
&&
`1px solid
${
theme
.
backgroundOutline
}
`
}
;
outline:
${({
theme
})
=>
`1px solid
${
theme
.
backgroundOutline
}
`
}
;
box-shadow:
${({
redesignFlag
,
theme
})
=>
redesignFlag
&&
theme
.
deepShadow
}
;
box-shadow:
${({
theme
})
=>
theme
.
deepShadow
}
;
margin: 0;
margin: 0;
padding: 0;
padding: 0;
width: 100%;
width: 100%;
`
`
const
HeaderRow
=
styled
.
div
<
{
redesignFlag
?:
boolean
}
>
`
const
HeaderRow
=
styled
.
div
`
${({
theme
})
=>
theme
.
flexRowNoWrap
}
;
${({
theme
})
=>
theme
.
flexRowNoWrap
}
;
padding: 1rem 1rem;
padding: 1rem 1rem;
font-weight:
${({
redesignFlag
})
=>
(
redesignFlag
?
'
600
'
:
'
500
'
)}
;
font-weight:
600
;
size:
${({
redesignFlag
})
=>
redesignFlag
&&
'
16px
'
}
;
size:
16px
;
color:
${(
props
)
=>
(
props
.
color
===
'
blue
'
?
({
theme
})
=>
theme
.
deprecated_primary1
:
'
inherit
'
)}
;
color:
${(
props
)
=>
(
props
.
color
===
'
blue
'
?
({
theme
})
=>
theme
.
deprecated_primary1
:
'
inherit
'
)}
;
${({
theme
})
=>
theme
.
deprecated_mediaWidth
.
deprecated_upToMedium
`
${({
theme
})
=>
theme
.
deprecated_mediaWidth
.
deprecated_upToMedium
`
padding: 1rem;
padding: 1rem;
`
}
;
`
}
;
`
`
const
ContentWrapper
=
styled
.
div
<
{
redesignFlag
?:
boolean
}
>
`
const
ContentWrapper
=
styled
.
div
`
background-color:
${({
theme
,
redesignFlag
})
=>
(
redesignFlag
?
theme
.
backgroundSurface
:
theme
.
deprecated_bg0
)
}
;
background-color:
${({
theme
})
=>
theme
.
backgroundSurface
}
;
border:
${({
theme
,
redesignFlag
})
=>
redesignFlag
&&
`1px solid
${
theme
.
backgroundOutline
}
`
}
;
border:
${({
theme
})
=>
`1px solid
${
theme
.
backgroundOutline
}
`
}
;
padding: 0 1rem 1rem 1rem;
padding: 0 1rem 1rem 1rem;
border-bottom-left-radius: 20px;
border-bottom-left-radius: 20px;
border-bottom-right-radius: 20px;
border-bottom-right-radius: 20px;
...
@@ -155,8 +154,6 @@ export default function WalletModal({
...
@@ -155,8 +154,6 @@ export default function WalletModal({
const
[
connectedWallets
,
addWalletToConnectedWallets
]
=
useConnectedWallets
()
const
[
connectedWallets
,
addWalletToConnectedWallets
]
=
useConnectedWallets
()
const
redesignFlag
=
useRedesignFlag
()
const
redesignFlagEnabled
=
redesignFlag
===
RedesignVariant
.
Enabled
const
nftFlagEnabled
=
useNftFlag
()
===
NftVariant
.
Enabled
const
nftFlagEnabled
=
useNftFlag
()
===
NftVariant
.
Enabled
const
[
walletView
,
setWalletView
]
=
useState
(
WALLET_VIEWS
.
ACCOUNT
)
const
[
walletView
,
setWalletView
]
=
useState
(
WALLET_VIEWS
.
ACCOUNT
)
const
[
lastActiveWalletAddress
,
setLastActiveWalletAddress
]
=
useState
<
string
|
undefined
>
(
account
)
const
[
lastActiveWalletAddress
,
setLastActiveWalletAddress
]
=
useState
<
string
|
undefined
>
(
account
)
...
@@ -301,7 +298,7 @@ export default function WalletModal({
...
@@ -301,7 +298,7 @@ export default function WalletModal({
)
)
}
else
{
}
else
{
headerRow
=
(
headerRow
=
(
<
HeaderRow
redesignFlag=
{
redesignFlagEnabled
}
>
<
HeaderRow
>
<
HoverText
>
<
HoverText
>
<
Trans
>
Connect a wallet
</
Trans
>
<
Trans
>
Connect a wallet
</
Trans
>
</
HoverText
>
</
HoverText
>
...
@@ -367,16 +364,8 @@ export default function WalletModal({
...
@@ -367,16 +364,8 @@ export default function WalletModal({
}
}
return
(
return
(
<
Modal
<
Modal
isOpen=
{
walletModalOpen
}
onDismiss=
{
toggleWalletModal
}
minHeight=
{
false
}
maxHeight=
{
90
}
>
isOpen=
{
walletModalOpen
}
<
Wrapper
data
-
testid=
"wallet-modal"
>
{
getModalContent
()
}
</
Wrapper
>
onDismiss=
{
toggleWalletModal
}
minHeight=
{
false
}
maxHeight=
{
90
}
redesignFlag=
{
redesignFlagEnabled
}
>
<
Wrapper
data
-
testid=
"wallet-modal"
redesignFlag=
{
redesignFlagEnabled
}
>
{
getModalContent
()
}
</
Wrapper
>
</
Modal
>
</
Modal
>
)
)
}
}
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