-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #52 from bleu-fi/chart-skeleton
Add chart skeleton
- Loading branch information
Showing
3 changed files
with
39 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import React from "react"; | ||
import { Skeleton } from "./ui/Skeleton"; | ||
|
||
function BarSet() { | ||
return ( | ||
<> | ||
<Skeleton className="h-48 w-10" /> | ||
<Skeleton className="h-64 w-10" /> | ||
<Skeleton className="h-56 w-10" /> | ||
<Skeleton className="h-64 w-10" /> | ||
</> | ||
); | ||
} | ||
export function ChartSkeleton({ barsSetCount = 3, className = "" }) { | ||
const barSet = new Array(barsSetCount).fill(null); | ||
|
||
return ( | ||
<div className={`${className} p-4`}> | ||
<div className="flex flex-col items-center"> | ||
<div className="flex items-end space-x-2"> | ||
<span className="sr-only">Loading...</span> | ||
{barSet.map((_, barIndex) => ( | ||
// eslint-disable-next-line react/no-array-index-key | ||
<BarSet key={barIndex} /> | ||
))} | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters