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
c53d7fcc
Unverified
Commit
c53d7fcc
authored
Aug 18, 2022
by
Kaylee George
Committed by
GitHub
Aug 18, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: fix Explore search bar styling (#4405)
* fix search * fix responsive * fix width
parent
3de2e655
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
17 deletions
+10
-17
TokenSafetyMessage.tsx
src/components/TokenSafety/TokenSafetyMessage.tsx
+1
-1
SearchBar.tsx
src/components/Tokens/TokenTable/SearchBar.tsx
+9
-16
No files found.
src/components/TokenSafety/TokenSafetyMessage.tsx
View file @
c53d7fcc
...
@@ -8,7 +8,7 @@ import { ExternalLink } from 'theme'
...
@@ -8,7 +8,7 @@ import { ExternalLink } from 'theme'
import
{
Color
}
from
'
theme/styled
'
import
{
Color
}
from
'
theme/styled
'
const
Label
=
styled
.
div
<
{
color
:
Color
}
>
`
const
Label
=
styled
.
div
<
{
color
:
Color
}
>
`
width:
284px
;
width:
100%
;
padding: 12px 20px;
padding: 12px 20px;
background-color:
${({
color
})
=>
color
+
'
1F
'
}
;
background-color:
${({
color
})
=>
color
+
'
1F
'
}
;
border-radius: 16px;
border-radius: 16px;
...
...
src/components/Tokens/TokenTable/SearchBar.tsx
View file @
c53d7fcc
import
searchIcon
from
'
assets/svg/search.svg
'
import
searchIcon
from
'
assets/svg/search.svg
'
import
xIcon
from
'
assets/svg/x.svg
'
import
xIcon
from
'
assets/svg/x.svg
'
import
{
useAtom
}
from
'
jotai
'
import
{
useAtom
}
from
'
jotai
'
import
{
useState
}
from
'
react
'
import
styled
from
'
styled-components/macro
'
import
styled
from
'
styled-components/macro
'
import
{
MEDIUM_MEDIA_BREAKPOINT
}
from
'
../constants
'
import
{
MEDIUM_MEDIA_BREAKPOINT
}
from
'
../constants
'
...
@@ -12,33 +11,31 @@ const SearchBarContainer = styled.div`
...
@@ -12,33 +11,31 @@ const SearchBarContainer = styled.div`
display: flex;
display: flex;
flex: 1;
flex: 1;
`
`
const
SearchInput
=
styled
.
input
<
{
expanded
:
boolean
}
>
`
const
SearchInput
=
styled
.
input
`
background: no-repeat scroll 7px 7px;
background: no-repeat scroll 7px 7px;
background-image:
${({
expanded
})
=>
!
expanded
&&
`url(
${
searchIcon
}
)`
}
;
background-image:
url(
${
searchIcon
}
)
;
background-size: 20px 20px;
background-size: 20px 20px;
background-position: 1
4
px center;
background-position: 1
2
px center;
background-color: 'transparent';
background-color: 'transparent';
border-radius: 12px;
border-radius: 12px;
border: 1px solid
${({
theme
})
=>
theme
.
backgroundOutline
}
;
border: 1px solid
${({
theme
})
=>
theme
.
backgroundOutline
}
;
height: 100%;
height: 100%;
width:
${({
expanded
})
=>
(
expanded
?
'
100%
'
:
'
52px
'
)}
;
width:
min(300px, 100%)
;
font-size: 16px;
font-size: 16px;
padding-left:
35
px;
padding-left:
40
px;
color:
${({
theme
})
=>
theme
.
textPrimary
}
;
color:
${({
theme
})
=>
theme
.
textPrimary
}
;
transition: width 0.75s cubic-bezier(0, 0.795, 0, 1);
:hover {
:hover {
cursor:
${({
expanded
})
=>
!
expanded
&&
'
pointer
'
}
;
background-color:
${({
theme
})
=>
theme
.
backgroundModule
}
;
background-color:
${({
theme
})
=>
theme
.
backgroundModule
}
;
}
}
:focus {
:focus {
outline: none;
outline: none;
background-color:
${({
theme
})
=>
theme
.
accentActionSoft
}
;
background-color:
${({
theme
})
=>
theme
.
backgroundSurface
}
;
border:
none
;
border:
1.5px solid
${({
theme
})
=>
theme
.
accentActionSoft
}
;
}
}
::placeholder {
::placeholder {
color:
${({
expanded
,
theme
})
=>
(
expanded
?
theme
.
textTertiary
:
'
transparent
'
)
}
;
color:
${({
theme
})
=>
theme
.
textTertiary
}
;
}
}
::-webkit-search-cancel-button {
::-webkit-search-cancel-button {
-webkit-appearance: none;
-webkit-appearance: none;
...
@@ -58,16 +55,12 @@ const SearchInput = styled.input<{ expanded: boolean }>`
...
@@ -58,16 +55,12 @@ const SearchInput = styled.input<{ expanded: boolean }>`
export
default
function
SearchBar
()
{
export
default
function
SearchBar
()
{
const
[
filterString
,
setFilterString
]
=
useAtom
(
filterStringAtom
)
const
[
filterString
,
setFilterString
]
=
useAtom
(
filterStringAtom
)
const
[
isExpanded
,
setExpanded
]
=
useState
(
false
)
return
(
return
(
<
SearchBarContainer
>
<
SearchBarContainer
>
<
SearchInput
<
SearchInput
expanded=
{
isExpanded
}
type=
"search"
type=
"search"
placeholder=
"Search
by name or token addres
s"
placeholder=
"Search
token
s"
id=
"searchBar"
id=
"searchBar"
onBlur=
{
()
=>
isExpanded
&&
filterString
.
length
===
0
&&
setExpanded
(
false
)
}
onFocus=
{
()
=>
setExpanded
(
true
)
}
autoComplete=
"off"
autoComplete=
"off"
value=
{
filterString
}
value=
{
filterString
}
onChange=
{
({
target
:
{
value
}
})
=>
setFilterString
(
value
)
}
onChange=
{
({
target
:
{
value
}
})
=>
setFilterString
(
value
)
}
...
...
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