Skip to content

Commit a54e382

Browse files
liuxuan30Xuan
andauthored
fix hydration issue in chronark#4 (chronark#5)
Co-authored-by: Xuan <liuxuan30@noreply.github.com>
1 parent 74ffd5f commit a54e382

1 file changed

Lines changed: 36 additions & 38 deletions

File tree

app/projects/page.tsx

Lines changed: 36 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -55,47 +55,45 @@ export default async function ProjectsPage() {
5555

5656
<div className="grid grid-cols-1 gap-8 mx-auto lg:grid-cols-2 ">
5757
<Card>
58-
<Link href={`/projects/${featured.slug}`}>
59-
<article className="relative h-full w-full p-4 md:p-8">
60-
<div className="flex justify-between gap-2 items-center">
61-
<div className="text-xs text-zinc-100">
62-
{featured.date ? (
63-
<time dateTime={new Date(featured.date).toISOString()}>
64-
{Intl.DateTimeFormat(undefined, {
65-
dateStyle: "medium",
66-
}).format(new Date(featured.date))}
67-
</time>
68-
) : (
69-
<span>SOON</span>
70-
)}
71-
</div>
72-
<span className="text-zinc-500 text-xs flex items-center gap-1">
73-
<Eye className="w-4 h-4" />{" "}
74-
{Intl.NumberFormat("en-US", { notation: "compact" }).format(
75-
views[featured.slug] ?? 0,
76-
)}
77-
</span>
58+
<article className="relative h-full w-full p-4 md:p-8">
59+
<div className="flex justify-between gap-2 items-center">
60+
<div className="text-xs text-zinc-100">
61+
{featured.date ? (
62+
<time dateTime={new Date(featured.date).toISOString()}>
63+
{Intl.DateTimeFormat(undefined, {
64+
dateStyle: "medium",
65+
}).format(new Date(featured.date))}
66+
</time>
67+
) : (
68+
<span>SOON</span>
69+
)}
7870
</div>
71+
<span className="text-zinc-500 text-xs flex items-center gap-1">
72+
<Eye className="w-4 h-4" />{" "}
73+
{Intl.NumberFormat("en-US", { notation: "compact" }).format(
74+
views[featured.slug] ?? 0,
75+
)}
76+
</span>
77+
</div>
7978

80-
<h2
81-
id="featured-post"
82-
className="mt-4 text-3xl font-bold text-zinc-100 group-hover:text-white sm:text-4xl font-display"
79+
<h2
80+
id="featured-post"
81+
className="mt-4 text-3xl font-bold text-zinc-100 group-hover:text-white sm:text-4xl font-display"
82+
>
83+
{featured.title}
84+
</h2>
85+
<p className="mt-4 leading-8 duration-150 text-zinc-400 group-hover:text-zinc-300">
86+
{featured.description}
87+
</p>
88+
<div className="absolute bottom-4 md:bottom-8">
89+
<Link
90+
className="text-zinc-200 hover:text-zinc-50 hidden lg:block"
91+
href={`/projects/${featured.slug}`}
8392
>
84-
{featured.title}
85-
</h2>
86-
<p className="mt-4 leading-8 duration-150 text-zinc-400 group-hover:text-zinc-300">
87-
{featured.description}
88-
</p>
89-
<div className="absolute bottom-4 md:bottom-8">
90-
<Link
91-
className="text-zinc-200 hover:text-zinc-50 hidden lg:block"
92-
href={`/projects/${featured.slug}`}
93-
>
94-
Read more <span aria-hidden="true">&rarr;</span>
95-
</Link>
96-
</div>
97-
</article>
98-
</Link>
93+
Read more <span aria-hidden="true">&rarr;</span>
94+
</Link>
95+
</div>
96+
</article>
9997
</Card>
10098

10199
<div className="flex flex-col w-full gap-8 mx-auto border-t border-gray-900/10 lg:mx-0 lg:border-t-0 ">

0 commit comments

Comments
 (0)