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
2d729325
Unverified
Commit
2d729325
authored
Dec 14, 2023
by
Igor Stuev
Committed by
GitHub
Dec 14, 2023
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1419 from blockscout/stats-s
stats second fix
parents
fbba31f9
03e592e1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletion
+10
-1
NumberWidgetsList.tsx
ui/stats/NumberWidgetsList.tsx
+10
-1
No files found.
ui/stats/NumberWidgetsList.tsx
View file @
2d729325
...
...
@@ -7,6 +7,8 @@ import { STATS_COUNTER } from 'stubs/stats';
import
DataFetchAlert
from
'
../shared/DataFetchAlert
'
;
import
NumberWidget
from
'
./NumberWidget
'
;
const
UNITS_WITHOUT_SPACE
=
[
'
s
'
];
const
NumberWidgetsList
=
()
=>
{
const
{
data
,
isPlaceholderData
,
isError
}
=
useApiQuery
(
'
stats_counters
'
,
{
queryOptions
:
{
...
...
@@ -26,11 +28,18 @@ const NumberWidgetsList = () => {
{
data
?.
counters
?.
map
(({
id
,
title
,
value
,
units
,
description
},
index
)
=>
{
let
unitsStr
=
''
;
if
(
UNITS_WITHOUT_SPACE
.
includes
(
units
))
{
unitsStr
=
units
;
}
else
if
(
units
)
{
unitsStr
=
'
'
+
units
;
}
return
(
<
NumberWidget
key=
{
id
+
(
isPlaceholderData
?
index
:
''
)
}
label=
{
title
}
value=
{
`${ Number(value).toLocaleString(undefined, { maximumFractionDigits: 3, notation: 'compact' }) }
${ units ? units : ''
}`
}
value=
{
`${ Number(value).toLocaleString(undefined, { maximumFractionDigits: 3, notation: 'compact' }) }
${ unitsStr
}`
}
isLoading=
{
isPlaceholderData
}
description=
{
description
}
/>
...
...
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