Skip to content

Commit

Permalink
refactor: use dynamifest
Browse files Browse the repository at this point in the history
  • Loading branch information
lewxdev committed Aug 27, 2024
1 parent 7269454 commit 6d1116f
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 38 deletions.
21 changes: 9 additions & 12 deletions app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,39 +3,36 @@ import { GeistSans } from "geist/font/sans";
import { ThemeProvider } from "next-themes";
import { Header } from "@/components/header";
import { SocketProvider } from "@/components/socket-provider";
import { app } from "@/utils/const";
import "@/globals.css";

const title = "mmmines!";
const description = "an endless, massive multiplayer minesweeper game";

export const metadata: Metadata = {
title,
description,
title: app.NAME,
description: app.DESCRIPTION,
icons: {
icon: [
{ url: "/icon-light.svg" },
{ url: "/icon-dark.svg", media: "(prefers-color-scheme: dark)" },
],
},
manifest: "/manifest.json",
appleWebApp: {
capable: true,
title: app.NAME,
statusBarStyle: "default",
title,
},
metadataBase: new URL(process.env["BASE_URL"]!),
openGraph: {
title,
description,
siteName: title,
url: "https://mmmines.fly.dev",
title: app.NAME,
description: app.DESCRIPTION,
siteName: app.NAME,
url: app.URL,
locale: "en_US",
type: "website",
},
};

export const viewport: Viewport = {
themeColor: "#020617",
themeColor: app.THEME_COLOR,
};

export default function RootLayout(props: Readonly<React.PropsWithChildren>) {
Expand Down
29 changes: 29 additions & 0 deletions app/manifest.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import type { MetadataRoute } from "next";
import { app } from "./utils/const";

export default function manifest(): MetadataRoute.Manifest {
return {
name: app.NAME,
short_name: app.NAME,
theme_color: app.THEME_COLOR,
background_color: app.THEME_COLOR,
display: "standalone",
orientation: "any",
scope: "/",
start_url: "/",
icons: [
{
src: "icon-maskable.svg",
sizes: "any",
type: "image/svg+xml",
purpose: "any maskable" as "maskable",
},
{
src: "icon-monochrome.svg",
sizes: "any",
type: "image/svg+xml",
purpose: "monochrome",
},
],
};
}
6 changes: 6 additions & 0 deletions app/utils/const.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export const app = {
NAME: "mmmines!",
DESCRIPTION: "an endless, massive multiplayer minesweeper game",
URL: "https://mmmines.fly.dev",
THEME_COLOR: "#020617",
};
26 changes: 0 additions & 26 deletions public/manifest.json

This file was deleted.

0 comments on commit 6d1116f

Please sign in to comment.