Skip to content

Commit f9231ca

Browse files
royalpinto007claude
andcommitted
feat: vote buttons on hall of fame + fix supabase types for edit_token_expires_at
- Hall of fame rows now show VoteButtons instead of static score - types/supabase.ts: add edit_token_expires_at to Row/Insert/Update types Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 5d9ec2a commit f9231ca

2 files changed

Lines changed: 12 additions & 7 deletions

File tree

app/(public)/hall-of-fame/page.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type { Metadata } from "next";
22
import Link from "next/link";
33
import { fetchFeedPosts } from "@/lib/db/posts";
4+
import { VoteButtons } from "@/components/post/VoteButtons";
45

56
export const revalidate = 60;
67

@@ -68,7 +69,7 @@ export default async function HallOfFamePage() {
6869
<span className="hidden w-24 text-right font-mono text-[9px] uppercase tracking-widest text-text-tertiary sm:inline">
6970
Severity
7071
</span>
71-
<span className="w-16 text-right font-mono text-[9px] uppercase tracking-widest text-text-tertiary">
72+
<span className="w-28 text-right font-mono text-[9px] uppercase tracking-widest text-text-tertiary">
7273
Score
7374
</span>
7475
</div>
@@ -152,11 +153,12 @@ export default async function HallOfFamePage() {
152153
{SEVERITY_LABEL[post.damageLevel]}
153154
</div>
154155

155-
{/* Score */}
156-
<div className="w-16 text-right font-mono text-xs tabular-nums text-text-secondary">
157-
{post.voteScore >= 1000
158-
? `${(post.voteScore / 1000).toFixed(1)}k`
159-
: post.voteScore}
156+
{/* Vote buttons */}
157+
<div className="w-28 flex justify-end">
158+
<VoteButtons
159+
postId={post.id}
160+
initialScore={post.voteScore}
161+
/>
160162
</div>
161163
</li>
162164
);

types/supabase.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ export type Database = {
4747
submitter_handle: string | null;
4848
submitter_email: string | null;
4949
edit_token_hash: string;
50+
edit_token_expires_at: string | null;
5051
ip_hash: string;
5152
is_anonymous: boolean;
5253
vote_score: number;
@@ -66,7 +67,8 @@ export type Database = {
6667
screenshot_urls?: string[];
6768
submitter_handle?: string | null;
6869
submitter_email?: string | null;
69-
edit_token_hash: string;
70+
edit_token_hash?: string;
71+
edit_token_expires_at?: string | null;
7072
ip_hash: string;
7173
is_anonymous?: boolean;
7274
vote_score?: number;
@@ -87,6 +89,7 @@ export type Database = {
8789
submitter_handle?: string | null;
8890
submitter_email?: string | null;
8991
edit_token_hash?: string;
92+
edit_token_expires_at?: string | null;
9093
ip_hash?: string;
9194
is_anonymous?: boolean;
9295
vote_score?: number;

0 commit comments

Comments
 (0)