Files
dalcode-website/app/layout.tsx
T
2026-04-29 10:36:24 +08:00

75 lines
2.1 KiB
TypeScript

import type { Metadata } from "next"
import { Inter, Inter_Tight } from "next/font/google"
import { NextIntlClientProvider } from "next-intl"
import { getLocale, getMessages } from "next-intl/server"
import { ThemeProvider } from "next-themes"
import Header from "@/components/Header"
import Footer from "@/components/Footer"
import GsapAnimations from "@/components/GsapAnimations"
import RevealObserver from "@/components/RevealObserver"
import PageTransition from "@/components/PageTransition"
import { SITE_BRAND, SITE_DESCRIPTION, SITE_NAME } from "@/lib/site-content"
import "./webflow.css"
import "./globals.css"
const inter = Inter({
subsets: ["latin"],
weight: ["400", "500", "600"],
variable: "--font-inter",
display: "swap",
})
const interTight = Inter_Tight({
subsets: ["latin"],
weight: ["400", "500", "600"],
variable: "--font-inter-tight",
display: "swap",
})
const SITE_URL = process.env.NEXT_PUBLIC_SITE_URL ?? "http://localhost:3000"
export const metadata: Metadata = {
metadataBase: new URL(SITE_URL),
title: {
default: SITE_BRAND,
template: `%s | ${SITE_NAME}`,
},
description: SITE_DESCRIPTION,
openGraph: {
type: "website",
siteName: SITE_BRAND,
title: SITE_BRAND,
description: SITE_DESCRIPTION,
},
}
export default async function RootLayout({
children,
}: Readonly<{
children: React.ReactNode
}>) {
const locale = await getLocale()
const messages = await getMessages()
return (
<NextIntlClientProvider locale={locale} messages={messages}>
<html
lang={locale}
className={`w-mod-js w-mod-ix3 ${inter.variable} ${interTight.variable}`}
suppressHydrationWarning
>
<body className={inter.className}>
<ThemeProvider attribute="class" defaultTheme="light" enableSystem>
<div className="page-wrapper">
<Header />
<PageTransition>{children}</PageTransition>
<Footer />
</div>
<RevealObserver />
<GsapAnimations />
</ThemeProvider>
</body>
</html>
</NextIntlClientProvider>
)
}