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
495970c3
Commit
495970c3
authored
Dec 21, 2022
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
link for stats item on home page
parent
50912f55
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
2 deletions
+12
-2
Stats.tsx
ui/home/Stats.tsx
+3
-0
StatsItem.tsx
ui/home/StatsItem.tsx
+9
-2
No files found.
ui/home/Stats.tsx
View file @
495970c3
...
@@ -12,6 +12,7 @@ import gasIcon from 'icons/gas.svg';
...
@@ -12,6 +12,7 @@ import gasIcon from 'icons/gas.svg';
import
txIcon
from
'
icons/transactions.svg
'
;
import
txIcon
from
'
icons/transactions.svg
'
;
import
walletIcon
from
'
icons/wallet.svg
'
;
import
walletIcon
from
'
icons/wallet.svg
'
;
import
useFetch
from
'
lib/hooks/useFetch
'
;
import
useFetch
from
'
lib/hooks/useFetch
'
;
import
link
from
'
lib/link/link
'
;
import
StatsGasPrices
from
'
./StatsGasPrices
'
;
import
StatsGasPrices
from
'
./StatsGasPrices
'
;
import
StatsItem
from
'
./StatsItem
'
;
import
StatsItem
from
'
./StatsItem
'
;
...
@@ -52,6 +53,7 @@ const Stats = () => {
...
@@ -52,6 +53,7 @@ const Stats = () => {
icon=
{
blockIcon
}
icon=
{
blockIcon
}
title=
"Total blocks"
title=
"Total blocks"
value=
{
Number
(
data
.
total_blocks
).
toLocaleString
()
}
value=
{
Number
(
data
.
total_blocks
).
toLocaleString
()
}
url=
{
link
(
'
blocks
'
)
}
/>
/>
{
hasAvgBlockTime
&&
(
{
hasAvgBlockTime
&&
(
<
StatsItem
<
StatsItem
...
@@ -64,6 +66,7 @@ const Stats = () => {
...
@@ -64,6 +66,7 @@ const Stats = () => {
icon=
{
txIcon
}
icon=
{
txIcon
}
title=
"Total transactions"
title=
"Total transactions"
value=
{
Number
(
data
.
total_transactions
).
toLocaleString
()
}
value=
{
Number
(
data
.
total_transactions
).
toLocaleString
()
}
url=
{
link
(
'
txs
'
)
}
/>
/>
<
StatsItem
<
StatsItem
icon=
{
walletIcon
}
icon=
{
walletIcon
}
...
...
ui/home/StatsItem.tsx
View file @
495970c3
...
@@ -10,11 +10,12 @@ type Props = {
...
@@ -10,11 +10,12 @@ type Props = {
value
:
string
;
value
:
string
;
className
?:
string
;
className
?:
string
;
tooltipLabel
?:
React
.
ReactNode
;
tooltipLabel
?:
React
.
ReactNode
;
url
?:
string
;
}
}
const
LARGEST_BREAKPOINT
=
'
1240px
'
;
const
LARGEST_BREAKPOINT
=
'
1240px
'
;
const
StatsItem
=
({
icon
,
title
,
value
,
className
,
tooltipLabel
}:
Props
)
=>
{
const
StatsItem
=
({
icon
,
title
,
value
,
className
,
tooltipLabel
,
url
}:
Props
)
=>
{
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const
sxContainer
=
{}
as
any
;
const
sxContainer
=
{}
as
any
;
sxContainer
[
`@media screen and (min-width:
${
breakpoints
.
lg
}
) and (max-width:
${
LARGEST_BREAKPOINT
}
)`
]
=
{
flexDirection
:
'
column
'
};
sxContainer
[
`@media screen and (min-width:
${
breakpoints
.
lg
}
) and (max-width:
${
LARGEST_BREAKPOINT
}
)`
]
=
{
flexDirection
:
'
column
'
};
...
@@ -38,6 +39,10 @@ const StatsItem = ({ icon, title, value, className, tooltipLabel }: Props) => {
...
@@ -38,6 +39,10 @@ const StatsItem = ({ icon, title, value, className, tooltipLabel }: Props) => {
className=
{
className
}
className=
{
className
}
color=
{
useColorModeValue
(
'
black
'
,
'
white
'
)
}
color=
{
useColorModeValue
(
'
black
'
,
'
white
'
)
}
position=
"relative"
position=
"relative"
{
...
(
url
?
{
as
:
'
a
',
href
:
url
,
}
:
{})
}
>
>
<
Icon
as=
{
icon
}
boxSize=
{
7
}
/>
<
Icon
as=
{
icon
}
boxSize=
{
7
}
/>
<
Flex
<
Flex
...
@@ -54,7 +59,9 @@ const StatsItem = ({ icon, title, value, className, tooltipLabel }: Props) => {
...
@@ -54,7 +59,9 @@ const StatsItem = ({ icon, title, value, className, tooltipLabel }: Props) => {
<
Box
<
Box
position=
"absolute"
position=
"absolute"
top=
{
{
base
:
'
calc(50% - 12px)
'
,
lg
:
'
10px
'
,
xl
:
'
calc(50% - 12px)
'
}
}
top=
{
{
base
:
'
calc(50% - 12px)
'
,
lg
:
'
10px
'
,
xl
:
'
calc(50% - 12px)
'
}
}
right=
"10px"
>
right=
"10px"
cursor=
"pointer"
>
<
Icon
<
Icon
as=
{
infoIcon
}
as=
{
infoIcon
}
boxSize=
{
6
}
boxSize=
{
6
}
...
...
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