From 6efe4fb73445ea8acd54cbc750b5ef0321d8a50f Mon Sep 17 00:00:00 2001 From: Imamuzzaki Abu Salam Date: Sun, 16 Jun 2024 10:17:58 +0700 Subject: [PATCH] chore(app/layout.tsx): fix deprecated viewport nextjs 14 --- app/layout.tsx | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/app/layout.tsx b/app/layout.tsx index 5898b21a1..637b4556b 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -3,7 +3,7 @@ import "./styles/globals.scss"; import "./styles/markdown.scss"; import "./styles/highlight.scss"; import { getClientConfig } from "./config/client"; -import { type Metadata } from "next"; +import type { Metadata, Viewport } from "next"; import { SpeedInsights } from "@vercel/speed-insights/next"; import { getServerSideConfig } from "./config/server"; import { GoogleTagManager } from "@next/third-parties/google"; @@ -12,21 +12,22 @@ const serverConfig = getServerSideConfig(); export const metadata: Metadata = { title: "NextChat", description: "Your personal ChatGPT Chat Bot.", - viewport: { - width: "device-width", - initialScale: 1, - maximumScale: 1, - }, - themeColor: [ - { media: "(prefers-color-scheme: light)", color: "#fafafa" }, - { media: "(prefers-color-scheme: dark)", color: "#151515" }, - ], 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, }: {