layout.tsx 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. import "@ant-design/v5-patch-for-react-19";
  2. import { AntdRegistry } from "@ant-design/nextjs-registry";
  3. import type { Metadata } from "next";
  4. import { Geist, Geist_Mono } from "next/font/google";
  5. import "./globals.css";
  6. import { ConfigProvider } from "antd";
  7. import zhCN from "antd/locale/zh_CN";
  8. import { AuthProvider } from "@/contexts/AuthContext";
  9. const geistSans = Geist({
  10. variable: "--font-geist-sans",
  11. subsets: ["latin"],
  12. });
  13. const geistMono = Geist_Mono({
  14. variable: "--font-geist-mono",
  15. subsets: ["latin"],
  16. });
  17. export const metadata: Metadata = {
  18. title: "Lanu OP - 运营管理后台",
  19. description: "Lanu operation platform",
  20. };
  21. export default function RootLayout({
  22. children,
  23. }: Readonly<{
  24. children: React.ReactNode;
  25. }>) {
  26. return (
  27. <html lang="zh-CN">
  28. <body
  29. className={`${geistSans.variable} ${geistMono.variable} antialiased`}
  30. >
  31. <AntdRegistry>
  32. <ConfigProvider
  33. locale={zhCN}
  34. theme={{
  35. token: {
  36. colorPrimary: "#1890ff",
  37. },
  38. cssVar: true,
  39. }}
  40. >
  41. <AuthProvider>{children}</AuthProvider>
  42. </ConfigProvider>
  43. </AntdRegistry>
  44. </body>
  45. </html>
  46. );
  47. }