Skip to content

Commit

Permalink
fix: add stats loader
Browse files Browse the repository at this point in the history
  • Loading branch information
belopash committed Jun 16, 2024
1 parent 1a12a9d commit f4573c1
Showing 1 changed file with 20 additions and 11 deletions.
31 changes: 20 additions & 11 deletions src/pages/DashboardPage/Summary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import Grid from '@mui/material/Unstable_Grid2';

import { useNetworkSummary } from '@api/subsquid-network-squid';
import { Card } from '@components/Card';
import { Loader } from '@components/Loader';
import { useContracts } from '@network/useContracts';

export const WorkerColumnLabel = styled(Box, {
Expand Down Expand Up @@ -172,17 +173,25 @@ function Stats() {
}

export function NetworkSummary() {
const { isLoading } = useNetworkSummary();

return (
<Grid container spacing={2} direction="row" sx={{ mb: 4 }}>
<Grid xxs={12} xs={6}>
<OnlineInfo />
</Grid>
<Grid xxs={12} xs={6}>
<CurrentEpoch />
</Grid>
<Grid xxs={12}>
<Stats />
</Grid>
</Grid>
<>
{!isLoading ? (
<Grid container spacing={2} direction="row" sx={{ mb: 4 }}>
<Grid xxs={12} xs={6}>
<OnlineInfo />
</Grid>
<Grid xxs={12} xs={6}>
<CurrentEpoch />
</Grid>
<Grid xxs={12}>
<Stats />
</Grid>
</Grid>
) : (
<Loader />
)}
</>
);
}

0 comments on commit f4573c1

Please sign in to comment.