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
1897330f
Unverified
Commit
1897330f
authored
Jun 09, 2022
by
Zach Pomerantz
Committed by
GitHub
Jun 09, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: omit native from DOM props (#3902)
fix: omit native from dom
parent
6131d007
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
15 deletions
+18
-15
index.tsx
src/components/CurrencyLogo/index.tsx
+18
-15
No files found.
src/components/CurrencyLogo/index.tsx
View file @
1897330f
...
@@ -5,17 +5,23 @@ import styled from 'styled-components/macro'
...
@@ -5,17 +5,23 @@ import styled from 'styled-components/macro'
import
Logo
from
'
../Logo
'
import
Logo
from
'
../Logo
'
const
StyledLogo
=
styled
(
Logo
)
<
{
size
:
string
;
native
:
boolean
}
>
`
const
StyledLogo
=
styled
(
Logo
)
<
{
size
:
string
}
>
`
width:
${({
size
})
=>
size
}
;
width:
${({
size
})
=>
size
}
;
height:
${({
size
})
=>
size
}
;
height:
${({
size
})
=>
size
}
;
background: radial-gradient(white 50%, #ffffff00 calc(75% + 1px), #ffffff00 100%);
background: radial-gradient(white 50%, #ffffff00 calc(75% + 1px), #ffffff00 100%);
border-radius: 50%;
border-radius: 50%;
-mox-box-shadow: 0 0 1px
${({
native
})
=>
(
native
?
'
white
'
:
'
black
'
)}
;
-mox-box-shadow: 0 0 1px
black
;
-webkit-box-shadow: 0 0 1px
${({
native
})
=>
(
native
?
'
white
'
:
'
black
'
)}
;
-webkit-box-shadow: 0 0 1px
black
;
box-shadow: 0 0 1px
${({
native
})
=>
(
native
?
'
white
'
:
'
black
'
)}
;
box-shadow: 0 0 1px
black
;
border: 0px solid rgba(255, 255, 255, 0);
border: 0px solid rgba(255, 255, 255, 0);
`
`
const
StyledNativeLogo
=
styled
(
StyledLogo
)
`
-mox-box-shadow: 0 0 1px white;
-webkit-box-shadow: 0 0 1px white;
box-shadow: 0 0 1px white;
`
export
default
function
CurrencyLogo
({
export
default
function
CurrencyLogo
({
currency
,
currency
,
size
=
'
24px
'
,
size
=
'
24px
'
,
...
@@ -26,16 +32,13 @@ export default function CurrencyLogo({
...
@@ -26,16 +32,13 @@ export default function CurrencyLogo({
size
?:
string
size
?:
string
style
?:
React
.
CSSProperties
style
?:
React
.
CSSProperties
})
{
})
{
const
logoURIs
=
useCurrencyLogoURIs
(
currency
)
const
props
=
{
alt
:
`
${
currency
?.
symbol
??
'
token
'
}
logo
`,
size,
srcs: useCurrencyLogoURIs(currency),
style,
...rest,
}
return
(
return currency?.isNative ? <StyledNativeLogo {...props} /> : <StyledLogo {...props} />
<
StyledLogo
size=
{
size
}
native=
{
currency
?.
isNative
??
false
}
srcs=
{
logoURIs
}
alt=
{
`${currency?.symbol ?? 'token'} logo`
}
style=
{
style
}
{
...
rest
}
/>
)
}
}
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