Skip to content

Commit

Permalink
change spinner to visibility hidden after chart loads
Browse files Browse the repository at this point in the history
  • Loading branch information
henrygd committed Nov 12, 2024
1 parent 6043c59 commit e87af81
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
10 changes: 8 additions & 2 deletions beszel/site/src/components/routes/system.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -656,8 +656,14 @@ function ChartCard({
<CardDescription>{description}</CardDescription>
{cornerEl && <div className="relative py-1 block sm:w-44 sm:absolute sm:top-2.5 sm:end-3.5">{cornerEl}</div>}
</CardHeader>
<div className="ps-0 w-[calc(100%-1.5em)] h-48 md:h-52 relative">
{<Spinner msg={empty ? t`Waiting for enough records to display` : undefined} />}
<div className="ps-0 w-[calc(100%-1.5em)] h-48 md:h-52 relative group">
{
<Spinner
msg={empty ? t`Waiting for enough records to display` : undefined}
// className="group-has-[.opacity-100]:opacity-0 transition-opacity"
className="group-has-[.opacity-100]:invisible duration-100"
/>
}
{isIntersecting && children}
</div>
</Card>
Expand Down
5 changes: 3 additions & 2 deletions beszel/site/src/components/spinner.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import { cn } from "@/lib/utils"
import { LoaderCircleIcon } from "lucide-react"

export default function ({ msg }: { msg?: string }) {
export default function ({ msg, className }: { msg?: string; className?: string }) {
return (
<div className="flex flex-col items-center justify-center h-full absolute inset-0">
<div className={cn(className, "flex flex-col items-center justify-center h-full absolute inset-0")}>
{msg ? (
<p className={"opacity-60 mb-2 text-center text-sm px-4"}>{msg}</p>
) : (
Expand Down

0 comments on commit e87af81

Please sign in to comment.