Skip to content

Commit

Permalink
🐛 fix: upgrade viewport for nextjs 14 (#436)
Browse files Browse the repository at this point in the history
  • Loading branch information
arvinxx authored Nov 9, 2023
1 parent 4cffb22 commit 57d3d07
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
14 changes: 14 additions & 0 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Viewport } from 'next';
import { cookies } from 'next/headers';
import { PropsWithChildren } from 'react';

Expand Down Expand Up @@ -42,3 +43,16 @@ const RootLayout = ({ children }: PropsWithChildren) => {
export default RootLayout;

export { default as metadata } from './metadata';

export const viewport: Viewport = {
initialScale: 1,
maximumScale: 1,
minimumScale: 1,
themeColor: [
{ color: '#f8f8f8', media: '(prefers-color-scheme: light)' },
{ color: '#000', media: '(prefers-color-scheme: dark)' },
],
userScalable: false,
viewportFit: 'cover',
width: 'device-width',
};
13 changes: 1 addition & 12 deletions src/app/metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,7 @@ const metadata: Metadata = {
type: 'website',
url: homepage,
},
themeColor: [
{ color: '#f8f8f8', media: '(prefers-color-scheme: light)' },
{ color: '#000', media: '(prefers-color-scheme: dark)' },
],

title: {
default: title,
template: '%s · LobeChat',
Expand All @@ -57,14 +54,6 @@ const metadata: Metadata = {
],
title,
},
viewport: {
initialScale: 1,
maximumScale: 1,
minimumScale: 1,
userScalable: false,
viewportFit: 'cover',
width: 'device-width',
},
};

export default metadata;

0 comments on commit 57d3d07

Please sign in to comment.