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
cee32f97
Unverified
Commit
cee32f97
authored
Oct 13, 2022
by
Zach Pomerantz
Committed by
GitHub
Oct 13, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: display loaded logo on token details (#4922)
parent
cb480706
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
3 deletions
+11
-3
index.tsx
src/components/CurrencyLogo/index.tsx
+1
-1
ChartSection.tsx
src/components/Tokens/TokenDetails/ChartSection.tsx
+9
-2
index.tsx
src/pages/TokenDetails/index.tsx
+1
-0
No files found.
src/components/CurrencyLogo/index.tsx
View file @
cee32f97
...
@@ -37,7 +37,7 @@ export default function CurrencyLogo({
...
@@ -37,7 +37,7 @@ export default function CurrencyLogo({
src
?:
string
|
null
src
?:
string
|
null
})
{
})
{
const
logoURIs
=
useCurrencyLogoURIs
(
currency
)
const
logoURIs
=
useCurrencyLogoURIs
(
currency
)
const
srcs
=
useMemo
(()
=>
(
src
?
[
src
]
:
logoURIs
),
[
src
,
logoURIs
])
const
srcs
=
useMemo
(()
=>
(
src
?
[
src
,
...
logoURIs
]
:
logoURIs
),
[
src
,
logoURIs
])
const
props
=
{
const
props
=
{
alt
:
`
${
currency
?.
symbol
??
'
token
'
}
logo
`,
alt
:
`
${
currency
?.
symbol
??
'
token
'
}
logo
`,
size,
size,
...
...
src/components/Tokens/TokenDetails/ChartSection.tsx
View file @
cee32f97
import
{
Trans
}
from
'
@lingui/macro
'
import
{
Trans
}
from
'
@lingui/macro
'
import
{
NativeCurrency
,
Token
}
from
'
@uniswap/sdk-core
'
import
{
Currency
,
NativeCurrency
,
Token
}
from
'
@uniswap/sdk-core
'
import
{
ParentSize
}
from
'
@visx/responsive
'
import
{
ParentSize
}
from
'
@visx/responsive
'
import
CurrencyLogo
from
'
components/CurrencyLogo
'
import
CurrencyLogo
from
'
components/CurrencyLogo
'
import
{
VerifiedIcon
}
from
'
components/TokenSafety/TokenSafetyIcon
'
import
{
VerifiedIcon
}
from
'
components/TokenSafety/TokenSafetyIcon
'
...
@@ -70,10 +70,12 @@ export function useTokenLogoURI(
...
@@ -70,10 +70,12 @@ export function useTokenLogoURI(
export
default
function
ChartSection
({
export
default
function
ChartSection
({
token
,
token
,
currency
,
nativeCurrency
,
nativeCurrency
,
prices
,
prices
,
}:
{
}:
{
token
:
NonNullable
<
SingleTokenData
>
token
:
NonNullable
<
SingleTokenData
>
currency
?:
Currency
|
null
nativeCurrency
?:
Token
|
NativeCurrency
nativeCurrency
?:
Token
|
NativeCurrency
prices
:
PriceDurations
prices
:
PriceDurations
})
{
})
{
...
@@ -111,7 +113,12 @@ export default function ChartSection({
...
@@ -111,7 +113,12 @@ export default function ChartSection({
<
TokenInfoContainer
>
<
TokenInfoContainer
>
<
TokenNameCell
>
<
TokenNameCell
>
<
LogoContainer
>
<
LogoContainer
>
<
CurrencyLogo
src=
{
logoSrc
}
size=
{
'
32px
'
}
symbol=
{
nativeCurrency
?.
symbol
??
token
.
symbol
}
/>
<
CurrencyLogo
src=
{
logoSrc
}
size=
{
'
32px
'
}
symbol=
{
nativeCurrency
?.
symbol
??
token
.
symbol
}
currency=
{
nativeCurrency
?
undefined
:
currency
}
/>
<
L2NetworkLogo
networkUrl=
{
L2Icon
}
size=
{
'
16px
'
}
/>
<
L2NetworkLogo
networkUrl=
{
L2Icon
}
size=
{
'
16px
'
}
/>
</
LogoContainer
>
</
LogoContainer
>
{
nativeCurrency
?.
name
??
token
.
name
??
<
Trans
>
Name not found
</
Trans
>
}
{
nativeCurrency
?.
name
??
token
.
name
??
<
Trans
>
Name not found
</
Trans
>
}
...
...
src/pages/TokenDetails/index.tsx
View file @
cee32f97
...
@@ -133,6 +133,7 @@ export default function TokenDetails() {
...
@@ -133,6 +133,7 @@ export default function TokenDetails() {
</
BreadcrumbNavLink
>
</
BreadcrumbNavLink
>
<
ChartSection
<
ChartSection
token=
{
tokenQueryData
}
token=
{
tokenQueryData
}
currency=
{
token
}
nativeCurrency=
{
isNative
?
nativeCurrency
:
undefined
}
nativeCurrency=
{
isNative
?
nativeCurrency
:
undefined
}
prices=
{
prices
}
prices=
{
prices
}
/>
/>
...
...
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