Files
jiang13-bbs/frontend/app/layout.tsx
freefire 0c2b0d2d6a 首次提交:姜十三论坛
后端 Go+Gin:认证/CSRF/限流、板块、帖子、评论、点赞、通知、用户资料、置顶推荐;前端 Next.js 16:发帖/编辑/删除、搜索、分页、点赞、通知中心、设置;基础设施 docker-compose 与配置模板;添加 .gitignore 与专有许可证(保留所有权利)
2026-09-12 01:11:05 +08:00

37 lines
961 B
TypeScript

import type { Metadata } from "next";
import { cookies } from "next/headers";
import "./globals.css";
import Header from "@/components/Header";
import Footer from "@/components/Footer";
export const metadata: Metadata = {
title: "姜十三论坛",
description: "姜十三论坛 - 技术分享与讨论社区",
openGraph: {
title: "姜十三论坛",
description: "姜十三论坛 - 技术分享与讨论社区",
type: "website",
},
};
export default async function RootLayout({
children,
}: {
children: React.ReactNode;
}) {
const cookieStore = await cookies();
const theme = cookieStore.get("j13-theme")?.value || "light";
return (
<html lang="zh-CN" className={theme === "dark" ? "dark" : ""}>
<body className="min-h-screen flex flex-col">
<Header />
<main className="flex-1 max-w-5xl mx-auto w-full px-4 py-6">
{children}
</main>
<Footer />
</body>
</html>
);
}