Skip to content

Commit

Permalink
refactor: optimize conditional rendering in page.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
EdSDR committed Oct 16, 2024
1 parent d33c292 commit b48fa04
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/commune-validator/src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,12 @@ export default function Page() {
</div>
<div className="gird-cols-1 grid w-full animate-fade-down gap-3 pb-3 animate-delay-[650ms] md:grid-cols-3">
{/* TODO: spinners */}
{moduleStakeData?.length ? (
{moduleStakeData && moduleStakeData.length > 0 ? (
<ModuleBarChart chartData={moduleStakeData} />
) : (
<Card className="h-full w-full animate-pulse" />
)}
{subnetData?.length ? (
{subnetData && subnetData.length > 0 ? (
<SubnetPieChart chartData={subnetData} />
) : (
<Card className="h-full w-full animate-pulse" />
Expand Down

0 comments on commit b48fa04

Please sign in to comment.