From e957879212efe419339aa3212e3d8a55dbd3a515 Mon Sep 17 00:00:00 2001 From: Ivan Rezchikov Date: Fri, 17 Jul 2026 12:14:25 +0300 Subject: [PATCH] feat: news page is centered --- app/[type]/[slug]/page.tsx | 38 ++++++++++++++++++++++++-------------- app/page.tsx | 1 + 2 files changed, 25 insertions(+), 14 deletions(-) diff --git a/app/[type]/[slug]/page.tsx b/app/[type]/[slug]/page.tsx index b30f46d..0c0a2c2 100644 --- a/app/[type]/[slug]/page.tsx +++ b/app/[type]/[slug]/page.tsx @@ -14,6 +14,7 @@ import { getNavLinkByPageId } from "@/lib/navlinks/repository"; import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table"; import { Metadata } from "next"; import { getImageUrl } from "@/lib/image"; +import { Badge } from "@/components/ui/badge"; function makeDescription(text?: string, maxLength = 160) { if (!text) return undefined; @@ -127,7 +128,7 @@ function BlockRenderer({ block }: { block: Block }) { case "CALLOUT": return ( - + {b.title} {b.text} @@ -200,8 +201,8 @@ function BlockRenderer({ block }: { block: Block }) { return ; case "LINK": - return - + return + default: @@ -249,6 +250,8 @@ export default async function Page({ params }: { params: Promise<{ type: string; user?.isAdmin && wasUpdatedByOther && updatedBy ? `${updatedBy.firstName} ${updatedBy.secondName}` : null, + + tags: isNews ? page.meta.tags : null, }; return ( @@ -273,18 +276,25 @@ export default async function Page({ params }: { params: Promise<{ type: string; {meta.author &&

{meta.author}

} {meta.updatedBy &&

Last update by {meta.updatedBy}

} + {isNews && (
+ {((meta as PageMeta)?.tags)?.map((tag) => ( + {tag} + ))} +
)} -
- {isArchived && ( - - - This page is archived - It can be seen only by administrators. Make any edits to make it visible again. - - )} - {resolvedBlocks.map((block) => ( - - ))} +
+
+ {isArchived && ( + + + This page is archived + It can be seen only by administrators. Make any edits to make it visible again. + + )} + {resolvedBlocks.map((block) => ( + + ))} +
); diff --git a/app/page.tsx b/app/page.tsx index 33e22af..dcab1b4 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -1,6 +1,7 @@ import { NewsCard } from "@/components/news-card"; import { getPages } from "@/lib/pages/repository"; import { ArrowRightIcon } from "lucide-react"; +import Image from "next/image"; import Link from "next/link"; export default async function Home() {