From c504a773384bdaeddf6080ce749ecd39e12b24e5 Mon Sep 17 00:00:00 2001 From: Sebastien Castiel Date: Sun, 10 Dec 2023 12:04:15 -0500 Subject: PWA --- src/app/layout.tsx | 10 +++++++--- src/app/manifest.ts | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 3 deletions(-) create mode 100644 src/app/manifest.ts (limited to 'src') diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 9fd82b0..2560871 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -3,7 +3,7 @@ import { ThemeProvider } from '@/components/theme-provider' import { ThemeToggle } from '@/components/theme-toggle' import { Button } from '@/components/ui/button' import { env } from '@/lib/env' -import type { Metadata } from 'next' +import type { Metadata, Viewport } from 'next' import Image from 'next/image' import Link from 'next/link' import './globals.css' @@ -40,18 +40,22 @@ export const metadata: Metadata = { applicationName: 'Spliit', icons: [ { - url: '/public/android-chrome-192x192.png', + url: '/android-chrome-192x192.png', sizes: '192x192', type: 'image/png', }, { - url: '/public/android-chrome-512x512.png', + url: '/android-chrome-512x512.png', sizes: '512x512', type: 'image/png', }, ], } +export const viewport: Viewport = { + themeColor: '#047857', +} + export default function RootLayout({ children, }: { diff --git a/src/app/manifest.ts b/src/app/manifest.ts new file mode 100644 index 0000000..6fdb9da --- /dev/null +++ b/src/app/manifest.ts @@ -0,0 +1,32 @@ +import { MetadataRoute } from 'next' + +export default function manifest(): MetadataRoute.Manifest { + return { + name: 'Spliit', + short_name: 'Spliit', + description: + 'A minimalist web application to share expenses with friends and family. No ads, no account, no problem.', + start_url: '/', + display: 'standalone', + background_color: '#fff', + theme_color: '#047857', + icons: [ + { + src: '/android-chrome-192x192.png', + sizes: '192x192', + type: 'image/png', + }, + { + src: '/android-chrome-512x512.png', + sizes: '512x512', + type: 'image/png', + }, + { + src: '/logo-512x512-maskable.png', + sizes: '512x512', + type: 'image/png', + purpose: 'maskable', + }, + ], + } +} -- cgit v1.3