Commit 7886d41a authored by Yuri Mikhin's avatar Yuri Mikhin Committed by Yuri Mikhin

Add new number stats widgets.

parent 79ec74ef
...@@ -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 = {
......
...@@ -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>
); );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment