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
98d4e108
Unverified
Commit
98d4e108
authored
Aug 31, 2022
by
Jack Short
Committed by
GitHub
Aug 31, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: search icon bug (#4556)
parent
ab43ed19
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
52 deletions
+54
-52
SearchBar.tsx
src/components/NavBar/SearchBar.tsx
+54
-52
No files found.
src/components/NavBar/SearchBar.tsx
View file @
98d4e108
...
...
@@ -332,62 +332,64 @@ export const SearchBar = () => {
const
placeholderText
=
phase1Flag
===
NftVariant
.
Enabled
?
t
`Search tokens and NFT collections`
:
t
`Search tokens`
return
(
<
Box
position=
"relative"
>
<
Box
position=
{
isOpen
?
{
sm
:
'
fixed
'
,
md
:
'
absolute
'
}
:
'
static
'
}
width=
{
{
sm
:
isOpen
?
'
viewWidth
'
:
'
auto
'
,
md
:
'
auto
'
}
}
ref=
{
searchRef
}
className=
{
styles
.
searchBarContainer
}
>
<
Row
className=
{
clsx
(
`${styles.searchBar} ${!isOpen && magicalGradientOnHover}`
)
}
borderRadius=
{
isOpen
?
undefined
:
'
12
'
}
borderTopRightRadius=
{
isOpen
&&
!
isMobile
?
'
12
'
:
undefined
}
borderTopLeftRadius=
{
isOpen
&&
!
isMobile
?
'
12
'
:
undefined
}
borderBottomWidth=
{
isOpen
?
'
0px
'
:
'
1px
'
}
display=
{
{
sm
:
isOpen
?
'
flex
'
:
'
none
'
,
xl
:
'
flex
'
}
}
justifyContent=
{
isOpen
||
phase1Flag
===
NftVariant
.
Enabled
?
'
flex-start
'
:
'
center
'
}
onFocus=
{
()
=>
!
isOpen
&&
toggleOpen
()
}
onClick=
{
()
=>
!
isOpen
&&
toggleOpen
()
}
gap=
"12"
<>
<
Box
position=
"relative"
>
<
Box
position=
{
isOpen
?
{
sm
:
'
fixed
'
,
md
:
'
absolute
'
}
:
'
static
'
}
width=
{
{
sm
:
isOpen
?
'
viewWidth
'
:
'
auto
'
,
md
:
'
auto
'
}
}
ref=
{
searchRef
}
className=
{
styles
.
searchBarContainer
}
>
<
Box
display=
{
{
sm
:
'
none
'
,
md
:
'
flex
'
}
}
>
<
MagnifyingGlassIcon
/>
</
Box
>
<
Box
display=
{
{
sm
:
'
flex
'
,
md
:
'
none
'
}
}
color=
"placeholder"
onClick=
{
toggleOpen
}
>
<
ChevronLeftIcon
/>
<
Row
className=
{
clsx
(
`${styles.searchBar} ${!isOpen && magicalGradientOnHover}`
)
}
borderRadius=
{
isOpen
?
undefined
:
'
12
'
}
borderTopRightRadius=
{
isOpen
&&
!
isMobile
?
'
12
'
:
undefined
}
borderTopLeftRadius=
{
isOpen
&&
!
isMobile
?
'
12
'
:
undefined
}
borderBottomWidth=
{
isOpen
?
'
0px
'
:
'
1px
'
}
display=
{
{
sm
:
isOpen
?
'
flex
'
:
'
none
'
,
xl
:
'
flex
'
}
}
justifyContent=
{
isOpen
||
phase1Flag
===
NftVariant
.
Enabled
?
'
flex-start
'
:
'
center
'
}
onFocus=
{
()
=>
!
isOpen
&&
toggleOpen
()
}
onClick=
{
()
=>
!
isOpen
&&
toggleOpen
()
}
gap=
"12"
>
<
Box
display=
{
{
sm
:
'
none
'
,
md
:
'
flex
'
}
}
>
<
MagnifyingGlassIcon
/>
</
Box
>
<
Box
display=
{
{
sm
:
'
flex
'
,
md
:
'
none
'
}
}
color=
"placeholder"
onClick=
{
toggleOpen
}
>
<
ChevronLeftIcon
/>
</
Box
>
<
Box
as=
"input"
placeholder=
{
placeholderText
}
width=
{
isOpen
||
phase1Flag
===
NftVariant
.
Enabled
?
'
full
'
:
'
120
'
}
onChange=
{
(
event
:
ChangeEvent
<
HTMLInputElement
>
)
=>
{
!
isOpen
&&
toggleOpen
()
setSearchValue
(
event
.
target
.
value
)
}
}
className=
{
styles
.
searchBarInput
}
value=
{
searchValue
}
ref=
{
inputRef
}
/>
</
Row
>
<
Box
display=
{
{
sm
:
isOpen
?
'
none
'
:
'
flex
'
,
xl
:
'
none
'
}
}
>
<
NavIcon
onClick=
{
toggleOpen
}
>
<
NavMagnifyingGlassIcon
width=
{
28
}
height=
{
28
}
/>
</
NavIcon
>
</
Box
>
<
Box
as=
"input"
placeholder=
{
placeholderText
}
width=
{
isOpen
||
phase1Flag
===
NftVariant
.
Enabled
?
'
full
'
:
'
120
'
}
onChange=
{
(
event
:
ChangeEvent
<
HTMLInputElement
>
)
=>
{
!
isOpen
&&
toggleOpen
()
setSearchValue
(
event
.
target
.
value
)
}
}
className=
{
styles
.
searchBarInput
}
value=
{
searchValue
}
ref=
{
inputRef
}
/>
</
Row
>
<
Box
display=
{
{
sm
:
isOpen
?
'
none
'
:
'
flex
'
,
xl
:
'
none
'
}
}
>
<
NavIcon
onClick=
{
toggleOpen
}
>
<
NavMagnifyingGlassIcon
width=
{
28
}
height=
{
28
}
/>
</
NavIcon
>
{
isOpen
&&
(
debouncedSearchValue
.
length
>
0
&&
(
tokensAreLoading
||
collectionsAreLoading
)
?
(
<
SkeletonRow
/>
)
:
(
<
SearchBarDropdown
toggleOpen=
{
toggleOpen
}
tokens=
{
reducedTokens
}
collections=
{
reducedCollections
}
hasInput=
{
debouncedSearchValue
.
length
>
0
}
/>
))
}
</
Box
>
{
isOpen
&&
(
debouncedSearchValue
.
length
>
0
&&
(
tokensAreLoading
||
collectionsAreLoading
)
?
(
<
SkeletonRow
/>
)
:
(
<
SearchBarDropdown
toggleOpen=
{
toggleOpen
}
tokens=
{
reducedTokens
}
collections=
{
reducedCollections
}
hasInput=
{
debouncedSearchValue
.
length
>
0
}
/>
))
}
</
Box
>
{
isOpen
&&
<
Overlay
/>
}
</
Box
>
</>
)
}
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