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
+6 -9
View File
@@ -6,6 +6,7 @@ import { useEffect, useState } from "react";
import { Badge } from "~/components/ui/badge";
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "~/components/ui/card";
import { Skeleton } from "~/components/ui/skeleton";
import { CardSkeleton } from "~/components/ui/skeletons";
import type { Publication } from "~/lib/bibtex";
import { parseBibtex } from "~/lib/bibtex";
@@ -67,15 +68,11 @@ export default function PublicationsPage() {
<div className="space-y-6">
{loading ? (
<Card>
<CardHeader className="pb-2">
<Skeleton className="h-6 w-1/2" />
</CardHeader>
<CardContent>
<Skeleton className="h-4 w-full" />
<Skeleton className="h-4 w-full mt-2" />
</CardContent>
</Card>
<>
<CardSkeleton />
<CardSkeleton />
<CardSkeleton />
</>
) : (
publications.map((pub, index) => (
<Card key={index}>