Skip to content

Commit fe81846

Browse files
O2saCopilot
andcommitted
style: enhance DashboardSkeleton layout and update Skeleton component styles
Co-authored-by: Copilot <copilot@github.com>
1 parent d578ce9 commit fe81846

2 files changed

Lines changed: 75 additions & 11 deletions

File tree

components/skeletons.tsx

Lines changed: 71 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,80 @@
11
import { Skeleton } from "@/components/ui/skeleton";
2+
import { Card, CardContent, CardHeader, CardTitle } from "./ui/card";
23

34
export function DashboardSkeleton() {
45
return (
5-
<div className="space-y-5 animate-pulse">
6-
<Skeleton className="h-24 rounded-xl" />
7-
<div className="grid gap-3 md:grid-cols-2 lg:grid-cols-4">
8-
<Skeleton className="h-24 rounded-lg" />
9-
<Skeleton className="h-24 rounded-lg" />
10-
<Skeleton className="h-24 rounded-lg" />
11-
<Skeleton className="h-24 rounded-lg" />
6+
<div className="space-y-6 animate-fadeIn">
7+
<Card className="border-2 border-primary/10 bg-gradient-to-r from-primary/5 via-primary/3 to-transparent">
8+
<CardContent className="p-6">
9+
<div className="flex items-center justify-between">
10+
<div className="flex items-center gap-4">
11+
<div className="rounded-full p-3">
12+
<Skeleton className="h-8 w-8 rounded-full" />
13+
</div>
14+
<div>
15+
<Skeleton className="h-6 w-48 rounded-md" />
16+
<Skeleton className="mt-2 h-5 w-36 rounded-md" />
17+
</div>
18+
</div>
19+
<div className="text-right">
20+
<Skeleton className="h-6 w-24 rounded-md" />
21+
<Skeleton className="mt-2 h-8 w-32 rounded-md" />
22+
</div>
23+
</div>
24+
</CardContent>
25+
</Card>
26+
27+
<div className="grid gap-3 sm:grid-cols-2">
28+
<Card>
29+
<CardHeader className="pb-3">
30+
<CardTitle>
31+
<Skeleton className="h-5 w-40" />
32+
</CardTitle>
33+
</CardHeader>
34+
<CardContent className="space-y-3">
35+
<div className="grid gap-3 sm:grid-cols-2">
36+
<Skeleton className="h-20 rounded-lg" />
37+
<Skeleton className="h-20 rounded-lg" />
38+
<Skeleton className="h-20 rounded-lg" />
39+
<Skeleton className="h-20 rounded-lg" />
40+
</div>
41+
</CardContent>
42+
</Card>
43+
44+
<Card>
45+
<CardHeader className="pb-3">
46+
<CardTitle>
47+
<Skeleton className="h-5 w-40" />
48+
</CardTitle>
49+
</CardHeader>
50+
<CardContent>
51+
<Skeleton className="h-72 rounded-xl" />
52+
</CardContent>
53+
</Card>
1254
</div>
13-
<Skeleton className="h-72 rounded-xl" />
55+
1456
<div className="grid gap-4 md:grid-cols-2">
15-
<Skeleton className="h-64 rounded-xl" />
16-
<Skeleton className="h-64 rounded-xl" />
57+
<Card>
58+
<CardHeader className="pb-3">
59+
<CardTitle>
60+
<Skeleton className="h-5 w-40" />
61+
</CardTitle>
62+
</CardHeader>
63+
<CardContent>
64+
<Skeleton className="h-64 rounded-xl" />
65+
</CardContent>
66+
</Card>
67+
68+
<Card>
69+
<CardHeader className="pb-3">
70+
<CardTitle>
71+
<Skeleton className="h-5 w-40" />
72+
</CardTitle>
73+
</CardHeader>
74+
<CardContent>
75+
<Skeleton className="h-64 rounded-xl" />
76+
</CardContent>
77+
</Card>
1778
</div>
1879
</div>
1980
);

components/ui/skeleton.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ function Skeleton({ className, ...props }: React.ComponentProps<"div">) {
44
return (
55
<div
66
data-slot="skeleton"
7-
className={cn("animate-pulse rounded-md bg-muted", className)}
7+
className={cn(
8+
"animate-pulse rounded-md bg-[hsl(var(--muted-foreground)/0.12)] dark:bg-[hsl(var(--muted)/1)]",
9+
className,
10+
)}
811
{...props}
912
/>
1013
)

0 commit comments

Comments
 (0)