Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 57 additions & 50 deletions app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,50 +1,57 @@
import type { ReactNode } from "react";
import type { Metadata, Viewport } from "next";
import "./globals.css";
import { Toaster } from "@/components/ui/toaster";

export const metadata: Metadata = {
title: "Taska",
description: "A lightweight, elegant to-do list application that works entirely in your browser",
manifest: "/manifest.json",
};

export const viewport: Viewport = {
width: "device-width",
initialScale: 1,
themeColor: "#000000",
};

export default function RootLayout({
children,
}: {
children: ReactNode;
}) {
return (
<html lang="en" suppressHydrationWarning>
<head>
{/* Prevent flicker by setting initial theme before React renders */}
<script
dangerouslySetInnerHTML={{
__html: `
(function () {
try {
const theme = localStorage.getItem("theme");
if (theme === "dark") {
document.documentElement.classList.add("dark");
}
} catch (_) {}
})();
`,
}}
/>
<meta name="apple-mobile-web-app-capable" content="yes" />
<link rel="apple-touch-icon" href="/logo.png" />
</head>
<body>
<Toaster />
{children}
</body>
</html>
);
}
import type { ReactNode } from "react";
import type { Metadata, Viewport } from "next";
import "./globals.css";
import { Toaster } from "@/components/ui/toaster";
import { getMessages } from "next-intl/server";
import { LocaleProvider } from "@/components/locale-provider";

export const metadata: Metadata = {
title: "Taska",
description:
"A lightweight, elegant to-do list application that works entirely in your browser",
manifest: "/manifest.json",
};

export const viewport: Viewport = {
width: "device-width",
initialScale: 1,
themeColor: "#000000",
};

export default async function RootLayout({
children,
}: {
children: ReactNode;
}) {
const messages = await getMessages();

return (
<html lang="en" suppressHydrationWarning>
<head>
{/* Prevent flicker by setting initial theme before React renders */}
<script
dangerouslySetInnerHTML={{
__html: `
(function () {
try {
const theme = localStorage.getItem("theme");
if (theme === "dark") {
document.documentElement.classList.add("dark");
}
} catch (_) {}
})();
`,
}}
/>
<meta name="apple-mobile-web-app-capable" content="yes" />
<link rel="apple-touch-icon" href="/logo.png" />
</head>
<body>
<LocaleProvider messages={messages}>
<Toaster />
{children}
</LocaleProvider>
</body>
</html>
);
}
Loading