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
7886d41a
Commit
7886d41a
authored
Dec 15, 2022
by
Yuri Mikhin
Committed by
Yuri Mikhin
Dec 19, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add new number stats widgets.
parent
79ec74ef
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
6 deletions
+30
-6
stats.ts
types/api/stats.ts
+7
-1
NumberWidgetsList.tsx
ui/stats/NumberWidgetsList.tsx
+23
-5
No files found.
types/api/stats.ts
View file @
7886d41a
...
@@ -20,7 +20,13 @@ export type GasPrices = {
...
@@ -20,7 +20,13 @@ export type GasPrices = {
}
}
export
type
Stats
=
{
export
type
Stats
=
{
totalBlocksAllTime
:
string
;
counters
:
{
averageBlockTime
:
string
;
completedTransactions
:
string
;
totalAccounts
:
string
;
totalBlocksAllTime
:
string
;
totalTransactions
:
string
;
};
}
}
export
type
Charts
=
{
export
type
Charts
=
{
...
...
ui/stats/NumberWidgetsList.tsx
View file @
7886d41a
...
@@ -10,7 +10,7 @@ import useFetch from 'lib/hooks/useFetch';
...
@@ -10,7 +10,7 @@ import useFetch from 'lib/hooks/useFetch';
import
NumberWidget
from
'
./NumberWidget
'
;
import
NumberWidget
from
'
./NumberWidget
'
;
import
NumberWidgetSkeleton
from
'
./NumberWidgetSkeleton
'
;
import
NumberWidgetSkeleton
from
'
./NumberWidgetSkeleton
'
;
const
skeletonsCount
=
4
;
const
skeletonsCount
=
5
;
const
NumberWidgetsList
=
()
=>
{
const
NumberWidgetsList
=
()
=>
{
const
fetch
=
useFetch
();
const
fetch
=
useFetch
();
...
@@ -28,10 +28,28 @@ const NumberWidgetsList = () => {
...
@@ -28,10 +28,28 @@ const NumberWidgetsList = () => {
{
isLoading
?
[
...
Array
(
skeletonsCount
)
]
{
isLoading
?
[
...
Array
(
skeletonsCount
)
]
.
map
((
e
,
i
)
=>
<
NumberWidgetSkeleton
key=
{
i
}
/>)
:
.
map
((
e
,
i
)
=>
<
NumberWidgetSkeleton
key=
{
i
}
/>)
:
(
(
<
NumberWidget
<>
label=
"Total blocks all time"
<
NumberWidget
value=
{
Number
(
data
?.
totalBlocksAllTime
).
toLocaleString
()
}
label=
"Total blocks"
/>
value=
{
Number
(
data
?.
counters
.
totalBlocksAllTime
).
toLocaleString
()
}
/>
<
NumberWidget
label=
"Average block time"
value=
{
Number
(
data
?.
counters
.
averageBlockTime
).
toLocaleString
()
}
/>
<
NumberWidget
label=
"Completed transactions"
value=
{
Number
(
data
?.
counters
.
completedTransactions
).
toLocaleString
()
}
/>
<
NumberWidget
label=
"Total transactions"
value=
{
Number
(
data
?.
counters
.
totalTransactions
).
toLocaleString
()
}
/>
<
NumberWidget
label=
"Total accounts"
value=
{
Number
(
data
?.
counters
.
totalAccounts
).
toLocaleString
()
}
/>
</>
)
}
)
}
</
Grid
>
</
Grid
>
);
);
...
...
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