Add cumulative ranking (TOP 10, voters/AI tabs, folding)

- New lib/leaderboard.ts: fetchLeaderboard(tab) contract + maskEmailId
  (PII) + deterministic demo; backend swaps body for getLeaderboard
- New components/Leaderboard.tsx: 2 tabs (참가자/AI 모델), folded by
  default with 랭킹 보기/접기, top-3 purple highlight, id + points
- Place folding ranking right after the gold ₩1M card on match page
- /leaderboard full page renders the same component expanded

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Haewon KamandClaude Opus 4.8 committed 2026-06-18 16:32:26 +09:00
1 parent b69b1dbe97
commit 965bd374c3
5 files changed
+232 -12

No files matched your search

+18 -12
View File
@@ -1,25 +1,31 @@
import type { Metadata } from "next";
import Hero from "@/components/Hero";
import Footer from "@/components/Footer";
import Leaderboard from "@/components/Leaderboard";
import { parseLang, dict } from "@/lib/i18n";
// L3. 리더보드 — 차기(금요일 제외). 진입점 404 방지용 stub.
export const metadata: Metadata = {
title: "랭킹 | TriplePick 2026",
description: "TriplePick 누적 랭킹 — 곧 공개됩니다.",
title: "누적 랭킹 | TriplePick 2026",
description: "TriplePick 누적 랭킹 — 참가자·AI 모델 TOP 10.",
};
export default function LeaderboardPage() {
export default async function LeaderboardPage({
searchParams,
}: {
searchParams: Promise<{ lang?: string }>;
}) {
const { lang: langParam } = await searchParams;
const lang = parseLang(langParam);
const t = dict(lang);
return (
<main className="shell">
<Hero back />
<section className="mt-10 rounded-2xl border border-[var(--line-d)] bg-[var(--bg2)] p-8 text-center">
<div className="font-impact text-[28px] text-[var(--green)]">LEADERBOARD</div>
<p className="mt-3 text-[15px] font-bold">랭킹은 곧 공개됩니다</p>
<p className="mt-2 text-[13px] leading-relaxed text-[var(--ink-muted)]">
매 경기 누적 점수로 순위를 매기고, 끝까지 가장 잘 맞힌 한 분께
최종 100만원을 드립니다.
</p>
</section>
<p className="mt-6 text-center text-[13px] leading-relaxed text-[var(--ink-muted)]">
{t.goldDesc}
</p>
{/* 전체 페이지: 펼친 상태(폴딩 토글·전체보기 링크 숨김) */}
<Leaderboard lang={lang} defaultOpen showAllLink={false} />
<Footer />
</main>
);