From 8637be92ba4a6946f2a07ee0513cdac6173015b8 Mon Sep 17 00:00:00 2001 From: Cho Young-Hwi Date: Sun, 15 Mar 2026 11:19:42 +0000 Subject: [PATCH] [#105] Rewrite home page with compact hero + storyline feed Content-first home page: compact hero (title + tagline), trending section with top 4 storylines, recent feed with 8 newest, "view all" link to discover, and empty state CTA. Server-side fetched with 120s ISR, reusing StoryCard component. Co-Authored-By: Claude Opus 4.6 (1M context) --- src/app/page.tsx | 100 ++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 91 insertions(+), 9 deletions(-) diff --git a/src/app/page.tsx b/src/app/page.tsx index 6baef83b..830f0a94 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,17 +1,99 @@ -export default function Home() { +import { createServerClient, type Storyline } from "../../lib/supabase"; +import { getTrendingStorylines } from "../../lib/ranking"; +import { StoryCard } from "../components/StoryCard"; +import Link from "next/link"; + +export const revalidate = 120; + +export default async function Home() { + const supabase = createServerClient(); + + let recent: Storyline[] = []; + let trending: Storyline[] = []; + + if (supabase) { + const { data } = await supabase + .from("storylines") + .select("*") + .eq("hidden", false) + .eq("sunset", false) + .order("block_timestamp", { ascending: false }) + .limit(8) + .returns(); + + recent = data ?? []; + trending = await getTrendingStorylines(supabase, 4).catch(() => []); + } + + const hasContent = recent.length > 0; + return ( -
-
-

+
+ {/* Compact hero */} +
+

PlotLink

-

+

Collaborative on-chain storytelling. Write the next chapter.

-
- $ npm run dev -
-

+ + + {hasContent ? ( + <> + {/* Trending section */} + {trending.length > 0 && ( +
+
+

+ #trending +

+
+
+ {trending.map((s) => ( + + ))} +
+
+ )} + + {/* Recent feed */} +
+
+

+ #recent +

+ + view all → + +
+
+ {recent.map((s) => ( + + ))} +
+
+ + ) : ( + /* Empty state */ +
+
+ $ no storylines found +
+

+ Be the first to start a story on PlotLink. +

+ + create storyline + +
+ )}
); }