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
7ba9b1fa
Unverified
Commit
7ba9b1fa
authored
Jul 19, 2022
by
Vignesh Mohankumar
Committed by
GitHub
Jul 19, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: don't toggle desktop NetworkSelector on click (#4134)
fix: don't NetworkSelector onClick on desktop
parent
5d43d08f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
7 deletions
+11
-7
NetworkSelector.tsx
src/components/Header/NetworkSelector.tsx
+11
-7
No files found.
src/components/Header/NetworkSelector.tsx
View file @
7ba9b1fa
...
...
@@ -17,6 +17,7 @@ import styled from 'styled-components/macro'
import
{
ExternalLink
,
MEDIA_WIDTHS
}
from
'
theme
'
import
{
replaceURLParam
}
from
'
utils/routes
'
import
{
isChainAllowed
,
switchChain
}
from
'
utils/switchChain
'
import
{
isMobile
}
from
'
utils/userAgent
'
const
ActiveRowLinkList
=
styled
.
div
`
display: flex;
...
...
@@ -120,20 +121,18 @@ const SelectorLabel = styled(NetworkLabel)`
margin-right: 8px;
}
`
const
SelectorControls
=
styled
.
div
<
{
interactive
:
boolean
}
>
`
const
SelectorControls
=
styled
.
div
`
align-items: center;
background-color:
${({
theme
})
=>
theme
.
bg0
}
;
border: 2px solid
${({
theme
})
=>
theme
.
bg0
}
;
border-radius: 16px;
color:
${({
theme
})
=>
theme
.
text1
}
;
cursor:
${({
interactive
})
=>
(
interactive
?
'
pointer
'
:
'
auto
'
)}
;
display: flex;
font-weight: 500;
justify-content: space-between;
padding: 6px 8px;
`
const
SelectorLogo
=
styled
(
Logo
)
<
{
interactive
?:
boolean
}
>
`
margin-right:
${({
interactive
})
=>
(
interactive
?
8
:
0
)}
px;
const
SelectorLogo
=
styled
(
Logo
)
`
@media screen and (min-width:
${
MEDIA_WIDTHS
.
upToSmall
}
px) {
margin-right: 8px;
}
...
...
@@ -338,9 +337,14 @@ export default function NetworkSelector() {
}
return
(
<
SelectorWrapper
ref=
{
node
}
onMouseEnter=
{
openModal
}
onMouseLeave=
{
closeModal
}
onClick=
{
toggleModal
}
>
<
SelectorControls
interactive
>
<
SelectorLogo
interactive
src=
{
info
.
logoUrl
}
/>
<
SelectorWrapper
ref=
{
node
}
onMouseEnter=
{
openModal
}
onMouseLeave=
{
closeModal
}
onClick=
{
isMobile
?
toggleModal
:
undefined
}
>
<
SelectorControls
>
<
SelectorLogo
src=
{
info
.
logoUrl
}
/>
<
SelectorLabel
>
{
info
.
label
}
</
SelectorLabel
>
<
StyledChevronDown
/>
</
SelectorControls
>
...
...
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