diff --git a/src/app/hack/[slug]/page.tsx b/src/app/hack/[slug]/page.tsx index 6a70fd7..41fd269 100644 --- a/src/app/hack/[slug]/page.tsx +++ b/src/app/hack/[slug]/page.tsx @@ -23,6 +23,7 @@ import { sortOrderedTags, getCoverUrls } from "@/utils/format"; import { RiArchiveStackFill } from "react-icons/ri"; import { isInformationalArchiveHack, isDownloadableArchiveHack, isArchiveHack, checkEditPermission } from "@/utils/hack"; import Avatar from "@/components/Account/Avatar"; +import CollapsibleCard from "@/components/Primitives/CollapsibleCard"; interface HackDetailProps { params: Promise<{ slug: string }>; @@ -197,10 +198,11 @@ export default async function HackDetail({ params }: HackDetailProps) { let patchId: number | null = null; let lastUpdated: string | null = null; let patchCreatedAt: string | null = null; + let patchChangelog: string | null = null; if (hack.current_patch != null) { const { data: patch } = await supabase .from("patches") - .select("id,bucket,filename,version,created_at") + .select("id,bucket,filename,version,created_at,changelog") .eq("id", hack.current_patch as number) .maybeSingle(); if (patch) { @@ -209,6 +211,7 @@ export default async function HackDetail({ params }: HackDetailProps) { patchId = patch.id; lastUpdated = new Date(patch.created_at).toLocaleDateString(); patchCreatedAt = patch.created_at; + patchChangelog = patch.changelog; } } @@ -405,6 +408,37 @@ export default async function HackDetail({ params }: HackDetailProps) {
+ {patchId && patchCreatedAt && ( + + {patchChangelog && patchChangelog.trim().length > 0 ? ( +
+ + {patchChangelog} + +
+ ) : ( +

No changelog provided

+ )} +
+ )} +

About this hack

diff --git a/src/components/Primitives/CollapsibleCard.tsx b/src/components/Primitives/CollapsibleCard.tsx index 26b3ccd..a14ec94 100644 --- a/src/components/Primitives/CollapsibleCard.tsx +++ b/src/components/Primitives/CollapsibleCard.tsx @@ -13,7 +13,7 @@ export default function CollapsibleCard({ title, children, defaultExpanded = fal const [isExpanded, setIsExpanded] = useState(defaultExpanded); return ( -
+