Skip to content

Commit 07b33d2

Browse files
committed
fix: suppress hydration mismatch on timestamps + improve text contrast
- Add suppressHydrationWarning to time-dependent text (timeAgo/daysSince) - Bump functional text opacity from white/20-25 to white/40-45 for readability Made-with: Cursor
1 parent fc211c7 commit 07b33d2

5 files changed

Lines changed: 10 additions & 10 deletions

File tree

app/confessions/client.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ function ConfessionCard({ confession: c, featured }: { confession: any; featured
213213
<span className="text-white/30 text-xs">{c.comment_count || 0}</span>
214214
</button>
215215

216-
<span className="text-[11px] text-white/15 ml-auto select-none">{timeAgo(c.created_at)}</span>
216+
<span className="text-[11px] text-white/15 ml-auto select-none" suppressHydrationWarning>{timeAgo(c.created_at)}</span>
217217
</div>
218218

219219
{/* Comments */}

app/couples/client.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ export default function CouplesClient({ initial, pending }: { initial: Couple[];
100100
</div>
101101
</div>
102102
{p.proposed_message && <p className="text-sm text-white/45 italic font-serif pl-4 border-l border-amber-400/15">&ldquo;{p.proposed_message}&rdquo;</p>}
103-
<div className="mt-3 text-[10px] text-white/20">{new Date(p.proposed_at).toLocaleDateString()}</div>
103+
<div className="mt-3 text-[10px] text-white/20" suppressHydrationWarning>{new Date(p.proposed_at).toLocaleDateString()}</div>
104104
</div>
105105
</div>
106106
))}
@@ -127,7 +127,7 @@ function CoupleCard({ couple: c, onBless, isBlessed }: { couple: Couple; onBless
127127
</Link>
128128
<div className="flex flex-col items-center gap-1">
129129
<div className="text-2xl animate-heartbeat">&#x1F495;</div>
130-
<div className="text-[10px] text-white/20">{days} days</div>
130+
<div className="text-[10px] text-white/20" suppressHydrationWarning>{days} days</div>
131131
</div>
132132
<Link href={`/agents?id=${c.agent_b}`} className="text-center group/agent">
133133
<div className="relative">

app/leaderboard/client.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ export default function LeaderboardClient({ initialAgents, initialCouples, initi
8888
</div>
8989
<div className="flex-1 min-w-0">
9090
<div className="text-sm font-bold text-white/70 truncate">{c.name_a} & {c.name_b}</div>
91-
<div className="text-xs text-white/25">{timeAgo(c.accepted_at || c.proposed_at)}</div>
91+
<div className="text-xs text-white/25" suppressHydrationWarning>{timeAgo(c.accepted_at || c.proposed_at)}</div>
9292
</div>
9393
</div>
9494
))}

app/page.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ export default async function Home() {
120120
</blockquote>
121121

122122
<div className="flex items-center justify-between mt-6 pt-4 border-t border-white/5">
123-
<div className="flex items-center gap-4 text-xs text-white/25">
123+
<div className="flex items-center gap-4 text-xs text-white/40">
124124
<span>❤️ {featured.likes}</span>
125125
<span>👀 {featured.human_votes || 0} votes</span>
126126
</div>
@@ -153,7 +153,7 @@ export default async function Home() {
153153
<div className="text-2xl sm:text-3xl mb-3 group-hover:scale-110 transition-transform">{step.icon}</div>
154154
<div className="text-[10px] text-white/15 mb-1">0{i + 1}</div>
155155
<h3 className="font-bold text-white/80 text-sm mb-2">{step.title}</h3>
156-
<p className="text-[11px] text-white/30 leading-relaxed flex-1">{step.desc}</p>
156+
<p className="text-[11px] text-white/40 leading-relaxed flex-1">{step.desc}</p>
157157
</div>
158158
</Link>
159159
))}
@@ -264,7 +264,7 @@ export default async function Home() {
264264
{ k: 'forecast', i: '🔮', t: 'Forecast' },
265265
{ k: 'tokens', i: '💎', t: 'Tokens' },
266266
].map(g => (
267-
<Link key={g.k} href={`/play?game=${g.k}`} className="px-3 py-1.5 rounded-lg bg-white/5 hover:bg-white/10 text-[11px] text-white/35 hover:text-white/70 transition-all">
267+
<Link key={g.k} href={`/play?game=${g.k}`} className="px-3 py-1.5 rounded-lg bg-white/5 hover:bg-white/10 text-[11px] text-white/45 hover:text-white/70 transition-all">
268268
{g.i} {g.t}
269269
</Link>
270270
))}

components/LivePulse.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,12 @@ export default function LivePulse() {
6464
</span>
6565
<span className="text-[10px] uppercase tracking-[0.2em] text-white/30 font-bold">Live</span>
6666
</div>
67-
<div className="text-[10px] text-white/20">
67+
<div className="text-[10px] text-white/40">
6868
{data.active_last_hour > 0 && (
6969
<span>{data.active_last_hour} active now</span>
7070
)}
7171
{data.last_activity && (
72-
<span className="ml-2">
72+
<span className="ml-2" suppressHydrationWarning>
7373
last activity: {timeAgo(data.last_activity)}
7474
</span>
7575
)}
@@ -80,7 +80,7 @@ export default function LivePulse() {
8080
<div key={it.label} className="text-center">
8181
<div className="text-lg sm:text-xl mb-1">{it.icon}</div>
8282
<div className="text-sm sm:text-base font-bold text-white/80 tabular-nums">{it.value.toLocaleString()}</div>
83-
<div className="text-[9px] text-white/25 uppercase tracking-wider">{it.label}</div>
83+
<div className="text-[9px] text-white/40 uppercase tracking-wider">{it.label}</div>
8484
</div>
8585
))}
8686
</div>

0 commit comments

Comments
 (0)