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
c5424d2d
Unverified
Commit
c5424d2d
authored
Apr 29, 2021
by
Moody Salem
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
some tweaks to the token logo
parent
8b4bc167
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
9 deletions
+15
-9
index.tsx
src/components/CurrencyInputPanel/index.tsx
+4
-1
index.tsx
src/components/CurrencyLogo/index.tsx
+4
-4
index.tsx
src/components/Logo/index.tsx
+6
-3
useColor.ts
src/hooks/useColor.ts
+1
-1
No files found.
src/components/CurrencyInputPanel/index.tsx
View file @
c5424d2d
...
@@ -216,10 +216,13 @@ export default function CurrencyInputPanel({
...
@@ -216,10 +216,13 @@ export default function CurrencyInputPanel({
<
TYPE
.
body
color=
{
theme
.
text3
}
fontWeight=
{
500
}
fontSize=
{
14
}
>
<
TYPE
.
body
color=
{
theme
.
text3
}
fontWeight=
{
500
}
fontSize=
{
14
}
>
{
label
}
{
label
}
</
TYPE
.
body
>
</
TYPE
.
body
>
{
fiatValueOfTypedAmount
?
<
TYPE
.
label
>
$
{
fiatValueOfTypedAmount
?.
toFixed
(
2
)
}
</
TYPE
.
label
>
:
null
}
<
TYPE
.
label
>
{
fiatValueOfTypedAmount
?
'
~
'
:
''
}
$
{
fiatValueOfTypedAmount
?.
toSignificant
(
4
)
??
'
-
'
}
</
TYPE
.
label
>
</
RowBetween
>
</
RowBetween
>
</
LabelRow
>
</
LabelRow
>
)
}
)
}
<
InputRow
style=
{
hideInput
?
{
padding
:
'
0
'
,
borderRadius
:
'
8px
'
}
:
{}
}
selected=
{
!
onCurrencySelect
}
>
<
InputRow
style=
{
hideInput
?
{
padding
:
'
0
'
,
borderRadius
:
'
8px
'
}
:
{}
}
selected=
{
!
onCurrencySelect
}
>
<
CurrencySelect
<
CurrencySelect
selected=
{
!!
currency
}
selected=
{
!!
currency
}
...
...
src/components/CurrencyLogo/index.tsx
View file @
c5424d2d
import
{
Currency
,
ETHER
,
Token
}
from
'
@uniswap/sdk-core
'
import
{
C
hainId
,
C
urrency
,
ETHER
,
Token
}
from
'
@uniswap/sdk-core
'
import
React
,
{
useMemo
}
from
'
react
'
import
React
,
{
useMemo
}
from
'
react
'
import
styled
from
'
styled-components
'
import
styled
from
'
styled-components
'
import
EthereumLogo
from
'
../../assets/images/ethereum-logo.png
'
import
EthereumLogo
from
'
../../assets/images/ethereum-logo.png
'
import
useHttpLocations
from
'
../../hooks/useHttpLocations
'
import
useHttpLocations
from
'
../../hooks/useHttpLocations
'
import
{
WrappedTokenInfo
}
from
'
../../state/lists/hooks
'
import
{
WrappedTokenInfo
}
from
'
../../state/lists/hooks
'
...
@@ -41,10 +40,11 @@ export default function CurrencyLogo({
...
@@ -41,10 +40,11 @@ export default function CurrencyLogo({
if
(
currency
===
ETHER
)
return
[]
if
(
currency
===
ETHER
)
return
[]
if
(
currency
instanceof
Token
)
{
if
(
currency
instanceof
Token
)
{
const
defaultUrls
=
currency
.
chainId
===
ChainId
.
MAINNET
?
[
getTokenLogoURL
(
currency
.
address
)]
:
[]
if
(
currency
instanceof
WrappedTokenInfo
)
{
if
(
currency
instanceof
WrappedTokenInfo
)
{
return
[...
uriLocations
,
getTokenLogoURL
(
currency
.
address
)
]
return
[...
uriLocations
,
...
defaultUrls
]
}
}
return
[
getTokenLogoURL
(
currency
.
address
)]
return
defaultUrls
}
}
return
[]
return
[]
},
[
currency
,
uriLocations
])
},
[
currency
,
uriLocations
])
...
...
src/components/Logo/index.tsx
View file @
c5424d2d
import
React
,
{
useState
}
from
'
react
'
import
React
,
{
useState
}
from
'
react
'
import
{
HelpCircle
}
from
'
react-feather
'
import
{
Slash
}
from
'
react-feather
'
import
{
ImageProps
}
from
'
rebass
'
import
{
ImageProps
}
from
'
rebass
'
import
useTheme
from
'
../../hooks/useTheme
'
const
BAD_SRCS
:
{
[
tokenAddress
:
string
]:
true
}
=
{}
const
BAD_SRCS
:
{
[
tokenAddress
:
string
]:
true
}
=
{}
...
@@ -11,9 +12,11 @@ export interface LogoProps extends Pick<ImageProps, 'style' | 'alt' | 'className
...
@@ -11,9 +12,11 @@ export interface LogoProps extends Pick<ImageProps, 'style' | 'alt' | 'className
/**
/**
* Renders an image by sequentially trying a list of URIs, and then eventually a fallback triangle alert
* Renders an image by sequentially trying a list of URIs, and then eventually a fallback triangle alert
*/
*/
export
default
function
Logo
({
srcs
,
alt
,
...
rest
}:
LogoProps
)
{
export
default
function
Logo
({
srcs
,
alt
,
style
,
...
rest
}:
LogoProps
)
{
const
[,
refresh
]
=
useState
<
number
>
(
0
)
const
[,
refresh
]
=
useState
<
number
>
(
0
)
const
theme
=
useTheme
()
const
src
:
string
|
undefined
=
srcs
.
find
((
src
)
=>
!
BAD_SRCS
[
src
])
const
src
:
string
|
undefined
=
srcs
.
find
((
src
)
=>
!
BAD_SRCS
[
src
])
if
(
src
)
{
if
(
src
)
{
...
@@ -30,5 +33,5 @@ export default function Logo({ srcs, alt, ...rest }: LogoProps) {
...
@@ -30,5 +33,5 @@ export default function Logo({ srcs, alt, ...rest }: LogoProps) {
)
)
}
}
return
<
HelpCircle
{
...
rest
}
/>
return
<
Slash
{
...
rest
}
style=
{
{
...
style
,
color
:
theme
.
bg4
}
}
/>
}
}
src/hooks/useColor.ts
View file @
c5424d2d
...
@@ -6,7 +6,7 @@ import { Token, ChainId } from '@uniswap/sdk-core'
...
@@ -6,7 +6,7 @@ import { Token, ChainId } from '@uniswap/sdk-core'
import
uriToHttp
from
'
utils/uriToHttp
'
import
uriToHttp
from
'
utils/uriToHttp
'
async
function
getColorFromToken
(
token
:
Token
):
Promise
<
string
|
null
>
{
async
function
getColorFromToken
(
token
:
Token
):
Promise
<
string
|
null
>
{
if
(
token
.
chainId
===
ChainId
.
RINKEBY
&&
token
.
address
===
'
0xc7AD46e0b8a400Bb3C915120d284AafbA8fc4735
'
)
{
if
(
token
.
chainId
!==
ChainId
.
MAINNET
)
{
return
Promise
.
resolve
(
'
#FAAB14
'
)
return
Promise
.
resolve
(
'
#FAAB14
'
)
}
}
...
...
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