From cbae53eab6250ae7a50190a2397761dcb46dfd96 Mon Sep 17 00:00:00 2001 From: Chad Miller Date: Tue, 30 Sep 2025 09:47:36 -0700 Subject: [PATCH] fix records card on slice overview, don't show hero content on the landing page if logged in --- .../src/features/landing/templates/LandingPage.tsx | 4 ++++ frontend/src/features/slices/overview/handlers.tsx | 13 ++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/frontend/src/features/landing/templates/LandingPage.tsx b/frontend/src/features/landing/templates/LandingPage.tsx index a431e63..db6e673 100644 --- a/frontend/src/features/landing/templates/LandingPage.tsx +++ b/frontend/src/features/landing/templates/LandingPage.tsx @@ -56,6 +56,8 @@ resp.records.forEach(album => { currentUser={currentUser} >
+ {!currentUser?.isAuthenticated && ( + <> {/* Hero Section */}
{
+ + )} diff --git a/frontend/src/features/slices/overview/handlers.tsx b/frontend/src/features/slices/overview/handlers.tsx index 7dfb9da..e7a20cd 100644 --- a/frontend/src/features/slices/overview/handlers.tsx +++ b/frontend/src/features/slices/overview/handlers.tsx @@ -2,7 +2,10 @@ import type { Route } from "@std/http/unstable-route"; import { withAuth } from "../../../routes/middleware.ts"; import { renderHTML } from "../../../utils/render.tsx"; import { SliceOverview } from "./templates/SliceOverview.tsx"; -import { withSliceAccess } from "../../../routes/slice-middleware.ts"; +import { + getSliceStats, + withSliceAccess, +} from "../../../routes/slice-middleware.ts"; import { extractSliceParams } from "../../../utils/slice-params.ts"; async function handleSliceOverview( @@ -34,10 +37,18 @@ async function handleSliceOverview( return Response.redirect(lexiconUrl, 302); } + const stats = await getSliceStats(context.sliceContext!.sliceUri); + const collections = stats.collections.map((stat) => ({ + name: stat.name, + count: stat.count, + actors: stat.actors, + })); + return renderHTML(