You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
	
	
		
			73 lines
		
	
	
		
			1.9 KiB
		
	
	
	
		
			TypeScript
		
	
		
		
			
		
	
	
			73 lines
		
	
	
		
			1.9 KiB
		
	
	
	
		
			TypeScript
		
	
| 
											9 months ago
										 | /* eslint-disable @next/next/no-page-custom-font */ | ||
|  | 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 { GoogleTagManager, GoogleAnalytics } from "@next/third-parties/google"; | ||
|  | import { getServerSideConfig } from "./config/server"; | ||
|  | 
 | ||
|  | export const metadata: Metadata = { | ||
|  |   title: "NextChat", | ||
|  |   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" }, | ||
|  |   ], | ||
|  | }; | ||
|  | 
 | ||
|  | export default function RootLayout({ | ||
|  |   children, | ||
|  | }: { | ||
|  |   children: React.ReactNode; | ||
|  | }) { | ||
|  |   const serverConfig = getServerSideConfig(); | ||
|  | 
 | ||
|  |   return ( | ||
|  |     <html lang="en"> | ||
|  |       <head> | ||
|  |         <meta name="config" content={JSON.stringify(getClientConfig())} /> | ||
|  |         <meta | ||
|  |           name="viewport" | ||
|  |           content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" | ||
|  |         /> | ||
|  |         <link | ||
|  |           rel="manifest" | ||
|  |           href="/site.webmanifest" | ||
|  |           crossOrigin="use-credentials" | ||
|  |         ></link> | ||
|  |         <script src="/serviceWorkerRegister.js" defer></script> | ||
|  |       </head> | ||
|  |       <body> | ||
|  |         {children} | ||
|  |         {serverConfig?.isVercel && ( | ||
|  |           <> | ||
|  |             <SpeedInsights /> | ||
|  |           </> | ||
|  |         )} | ||
|  |         {serverConfig?.gtmId && ( | ||
|  |           <> | ||
|  |             <GoogleTagManager gtmId={serverConfig.gtmId} /> | ||
|  |           </> | ||
|  |         )} | ||
|  |         {serverConfig?.gaId && ( | ||
|  |           <> | ||
|  |             <GoogleAnalytics gaId={serverConfig.gaId} /> | ||
|  |           </> | ||
|  |         )} | ||
|  |       </body> | ||
|  |     </html> | ||
|  |   ); | ||
|  | } |