Fix navbar hydration error/layout shift

This commit is contained in:
2024-10-28 22:24:54 -07:00
parent 40b93fe822
commit fcc9c21fcc
4 changed files with 135 additions and 79 deletions
+40
View File
@@ -0,0 +1,40 @@
import { Card, CardContent, CardHeader } from "./card";
import { Skeleton } from "./skeleton";
export function CardSkeleton() {
return (
<Card>
<CardHeader>
<div className="flex items-center justify-between">
<Skeleton className="h-6 w-1/3" />
<Skeleton className="h-5 w-5 rounded-full" />
</div>
<Skeleton className="h-4 w-full mt-2" />
</CardHeader>
<CardContent>
<Skeleton className="h-4 w-full" />
<Skeleton className="h-4 w-5/6 mt-2" />
<div className="flex gap-2 mt-4">
<Skeleton className="h-5 w-16" />
<Skeleton className="h-5 w-16" />
<Skeleton className="h-5 w-16" />
</div>
</CardContent>
</Card>
);
}
export function AboutCardSkeleton() {
return (
<Card>
<CardHeader>
<Skeleton className="h-6 w-1/4" />
</CardHeader>
<CardContent className="space-y-2">
<Skeleton className="h-4 w-full" />
<Skeleton className="h-4 w-full" />
<Skeleton className="h-4 w-3/4" />
</CardContent>
</Card>
);
}