diff --git a/app/layout.tsx b/app/layout.tsx index f836cd7..fd699d1 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -1,12 +1,30 @@ -import type { Metadata } from 'next'; +import type { Metadata, Viewport } from 'next'; import { cookies } from 'next/headers'; import './globals.css'; import { I18nProvider } from '@/lib/i18n/I18nProvider'; +import { ServiceWorkerRegister } from '@/components/pwa/ServiceWorkerRegister'; import type { Locale, Theme } from '@/lib/types'; export const metadata: Metadata = { title: 'Groupware', description: 'Project-based team collaboration tool', + applicationName: 'Groupware', + appleWebApp: { + capable: true, + statusBarStyle: 'default', + title: 'Groupware', + }, + icons: { + icon: '/icon.svg', + apple: '/icon-192.png', + }, +}; + +export const viewport: Viewport = { + width: 'device-width', + initialScale: 1, + viewportFit: 'cover', + themeColor: '#2563eb', }; function resolveTheme(v: string | undefined): Theme { @@ -36,6 +54,7 @@ export default async function RootLayout({ {children} + ); diff --git a/app/manifest.ts b/app/manifest.ts new file mode 100644 index 0000000..4944d6e --- /dev/null +++ b/app/manifest.ts @@ -0,0 +1,51 @@ +import type { MetadataRoute } from 'next'; + +/** + * PWA マニフェスト。Next.js が /manifest.webmanifest を生成し、 + * を自動で に出力する。 + */ +export default function manifest(): MetadataRoute.Manifest { + return { + name: 'Groupware', + short_name: 'Groupware', + description: 'Project-based team collaboration tool', + start_url: '/', + scope: '/', + display: 'standalone', + orientation: 'any', + background_color: '#111827', + theme_color: '#2563eb', + lang: 'en', + icons: [ + { + src: '/icon-192.png', + sizes: '192x192', + type: 'image/png', + purpose: 'any', + }, + { + src: '/icon-192.png', + sizes: '192x192', + type: 'image/png', + purpose: 'maskable', + }, + { + src: '/icon-512.png', + sizes: '512x512', + type: 'image/png', + purpose: 'any', + }, + { + src: '/icon-512.png', + sizes: '512x512', + type: 'image/png', + purpose: 'maskable', + }, + { + src: '/icon.svg', + sizes: 'any', + type: 'image/svg+xml', + }, + ], + }; +} diff --git a/components/layout/Header.tsx b/components/layout/Header.tsx index ae4d868..e3de4e9 100644 --- a/components/layout/Header.tsx +++ b/components/layout/Header.tsx @@ -24,10 +24,10 @@ export function Header({ user }: { user: PublicUser }) { > {t('app.name')} -