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