Skip to content

Commit

Permalink
♻️ refactor(config): Viewport
Browse files Browse the repository at this point in the history
  • Loading branch information
web-ppanel committed Nov 16, 2024
1 parent 937408f commit 24b8601
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
13 changes: 8 additions & 5 deletions apps/admin/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { currentUser } from '@/services/admin/user';
import { getGlobalConfig } from '@/services/common/common';
import '@shadcn/ui/globals.css';
import { Toaster } from '@shadcn/ui/sonner';
import { Metadata } from 'next';
import { Metadata, Viewport } from 'next';
import { NextIntlClientProvider } from 'next-intl';
import { getLocale, getMessages } from 'next-intl/server';
import { PublicEnvScript } from 'next-runtime-env';
Expand Down Expand Up @@ -45,15 +45,18 @@ export async function generateMetadata(): Promise<Metadata> {
apple: site?.site_logo || '/apple-touch-icon.png',
},
manifest: '/site.webmanifest',
themeColor: [
{ media: '(prefers-color-scheme: light)', color: '#FFFFFF' },
{ media: '(prefers-color-scheme: dark)', color: '#000000' },
],
};

return defaultMetadata;
}

export const viewport: Viewport = {
themeColor: [
{ media: '(prefers-color-scheme: light)', color: '#FFFFFF' },
{ media: '(prefers-color-scheme: dark)', color: '#000000' },
],
};

export default async function RootLayout({ children }: { children: React.ReactNode }) {
const locale = await getLocale();
const messages = await getMessages();
Expand Down
13 changes: 8 additions & 5 deletions apps/user/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { NextIntlClientProvider } from 'next-intl';
import { getLocale, getMessages } from 'next-intl/server';
import { PublicEnvScript } from 'next-runtime-env';
import { cookies } from 'next/headers';
import { Metadata } from 'next/types';
import { Metadata, Viewport } from 'next/types';
import NextTopLoader from 'nextjs-toploader';
import React from 'react';

Expand Down Expand Up @@ -45,14 +45,17 @@ export async function generateMetadata(): Promise<Metadata> {
apple: site?.site_logo || '/apple-touch-icon.png',
},
manifest: '/site.webmanifest',
themeColor: [
{ media: '(prefers-color-scheme: light)', color: '#FFFFFF' },
{ media: '(prefers-color-scheme: dark)', color: '#000000' },
],
};
return defaultMetadata;
}

export const viewport: Viewport = {
themeColor: [
{ media: '(prefers-color-scheme: light)', color: '#FFFFFF' },
{ media: '(prefers-color-scheme: dark)', color: '#000000' },
],
};

export default async function RootLayout({ children }: { children: React.ReactNode }) {
const locale = await getLocale();
const messages = await getMessages();
Expand Down

0 comments on commit 24b8601

Please sign in to comment.