ChatGPT-Next-Web/app/layout.tsx

72 lines
1.9 KiB
TypeScript
Raw Permalink Normal View History

2023-03-25 14:24:52 +00:00
/* eslint-disable @next/next/no-page-custom-font */
2023-03-19 14:13:00 +00:00
import "./styles/globals.scss";
import "./styles/markdown.scss";
import "./styles/highlight.scss";
import { getClientConfig } from "./config/client";
import type { Metadata, Viewport } from "next";
import { SpeedInsights } from "@vercel/speed-insights/next";
import { getServerSideConfig } from "./config/server";
2024-08-16 08:10:31 +00:00
import { GoogleTagManager, GoogleAnalytics } from "@next/third-parties/google";
const serverConfig = getServerSideConfig();
2023-03-07 15:23:54 +00:00
2023-07-16 13:34:01 +00:00
export const metadata: Metadata = {
2024-05-20 11:02:46 +00:00
title: "NextChat",
2023-03-25 14:24:52 +00:00
description: "Your personal ChatGPT Chat Bot.",
appleWebApp: {
title: "NextChat",
statusBarStyle: "default",
},
};
export const viewport: Viewport = {
width: "device-width",
initialScale: 1,
maximumScale: 1,
themeColor: [
{ media: "(prefers-color-scheme: light)", color: "#fafafa" },
{ media: "(prefers-color-scheme: dark)", color: "#151515" },
],
2023-03-09 17:01:40 +00:00
};
2023-03-07 15:23:54 +00:00
export default function RootLayout({
children,
}: {
2023-03-09 17:01:40 +00:00
children: React.ReactNode;
2023-03-07 15:23:54 +00:00
}) {
return (
2023-03-15 17:24:03 +00:00
<html lang="en">
<head>
<meta name="config" content={JSON.stringify(getClientConfig())} />
2024-08-16 08:10:31 +00:00
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"
/>
2024-09-18 02:39:56 +00:00
<link
rel="manifest"
href="/site.webmanifest"
crossOrigin="use-credentials"
></link>
2023-03-27 10:02:35 +00:00
<script src="/serviceWorkerRegister.js" defer></script>
</head>
<body>
{children}
{serverConfig?.isVercel && (
<>
<SpeedInsights />
</>
)}
2024-01-22 07:06:41 +00:00
{serverConfig?.gtmId && (
<>
<GoogleTagManager gtmId={serverConfig.gtmId} />
</>
)}
2024-08-16 08:10:31 +00:00
{serverConfig?.gaId && (
<>
<GoogleAnalytics gaId={serverConfig.gaId} />
</>
)}
</body>
2023-03-07 15:23:54 +00:00
</html>
2023-03-09 17:01:40 +00:00
);
2023-03-07 15:23:54 +00:00
}