Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
frontend
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
vicotor
frontend
Commits
ea50d53d
Unverified
Commit
ea50d53d
authored
Jan 26, 2023
by
Igor Stuev
Committed by
GitHub
Jan 26, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #549 from blockscout/token-seo
token seo
parents
f55f8a6c
c240f69b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
2 deletions
+16
-2
getSeo.ts
lib/next/token/getSeo.ts
+1
-1
Token.tsx
ui/pages/Token.tsx
+15
-1
No files found.
lib/next/token/getSeo.ts
View file @
ea50d53d
...
@@ -8,7 +8,7 @@ export default function getSeo(params: PageParams) {
...
@@ -8,7 +8,7 @@ export default function getSeo(params: PageParams) {
return
{
return
{
title
:
params
?
`
${
params
.
hash
}
-
${
networkTitle
}
`
:
''
,
title
:
params
?
`
${
params
.
hash
}
-
${
networkTitle
}
`
:
''
,
description
:
params
?
description
:
params
?
`
${
params
.
hash
}
, balances
, and analytics on the
on the
${
networkTitle
}
`
:
`
${
params
.
hash
}
, balances
and analytics
on the
${
networkTitle
}
`
:
''
,
''
,
};
};
}
}
ui/pages/Token.tsx
View file @
ea50d53d
import
{
Skeleton
,
Box
}
from
'
@chakra-ui/react
'
;
import
{
Skeleton
,
Box
}
from
'
@chakra-ui/react
'
;
import
{
useRouter
}
from
'
next/router
'
;
import
{
useRouter
}
from
'
next/router
'
;
import
React
from
'
react
'
;
import
React
,
{
useEffect
}
from
'
react
'
;
import
type
{
RoutedTab
}
from
'
ui/shared/RoutedTabs/types
'
;
import
type
{
RoutedTab
}
from
'
ui/shared/RoutedTabs/types
'
;
...
@@ -30,6 +30,20 @@ const TokenPageContent = () => {
...
@@ -30,6 +30,20 @@ const TokenPageContent = () => {
queryOptions
:
{
enabled
:
Boolean
(
router
.
query
.
hash
)
},
queryOptions
:
{
enabled
:
Boolean
(
router
.
query
.
hash
)
},
});
});
useEffect
(()
=>
{
if
(
tokenQuery
.
data
)
{
const
tokenName
=
`
${
tokenQuery
.
data
.
name
}
(
${
tokenQuery
.
data
.
symbol
}
)`
;
const
title
=
document
.
getElementsByTagName
(
'
title
'
)[
0
];
if
(
title
)
{
title
.
textContent
=
title
.
textContent
?.
replace
(
tokenQuery
.
data
.
address
,
tokenName
)
||
title
.
textContent
;
}
const
description
=
document
.
getElementsByName
(
'
description
'
)[
0
]
as
HTMLMetaElement
;
if
(
description
)
{
description
.
content
=
description
.
content
.
replace
(
tokenQuery
.
data
.
address
,
tokenName
)
||
description
.
content
;
}
}
},
[
tokenQuery
.
data
]);
const
transfersQuery
=
useQueryWithPages
({
const
transfersQuery
=
useQueryWithPages
({
resourceName
:
'
token_transfers
'
,
resourceName
:
'
token_transfers
'
,
pathParams
:
{
hash
:
router
.
query
.
hash
?.
toString
()
},
pathParams
:
{
hash
:
router
.
query
.
hash
?.
toString
()
},
...
...
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