correction des warning de couleur de theme

This commit is contained in:
Puechberty Arthur
2026-04-23 23:50:12 +02:00
parent 0d55fe5978
commit 3b4eef5fc2
+22 -38
View File
@@ -7,6 +7,7 @@ import { notFound } from "next/navigation";
import { RTL_LOCALES, routing } from "../../i18n/routing"; import { RTL_LOCALES, routing } from "../../i18n/routing";
import "../globals.css"; import "../globals.css";
/* ---------------- Fonts ---------------- */
const headingFont = Space_Grotesk({ const headingFont = Space_Grotesk({
subsets: ["latin"], subsets: ["latin"],
variable: "--font-heading", variable: "--font-heading",
@@ -19,13 +20,12 @@ const monoFont = IBM_Plex_Mono({
weight: ["400", "500"], weight: ["400", "500"],
}); });
/* ---------------- i18n params ---------------- */
export function generateStaticParams() { export function generateStaticParams() {
return routing.locales.map((locale) => ({ locale })); return routing.locales.map((locale) => ({ locale }));
} }
/** /* ---------------- Metadata (SEO only) ---------------- */
* SEO + i18n + PWA + Social metadata
*/
export async function generateMetadata({ export async function generateMetadata({
params, params,
}: { }: {
@@ -39,20 +39,13 @@ export async function generateMetadata({
const t = await getTranslations({ locale, namespace: "metadata" }); const t = await getTranslations({ locale, namespace: "metadata" });
const languages = routing.locales.reduce<Record<string, string>>( const languages = Object.fromEntries(
(acc, currentLocale) => { routing.locales.map((l) => [l, `/${l}`]),
acc[currentLocale] = `/${currentLocale}`;
return acc;
},
{},
); );
const title = t("title");
const description = t("description");
return { return {
title, title: t("title"),
description, description: t("description"),
metadataBase: new URL("https://flint.arthurp.fr"), metadataBase: new URL("https://flint.arthurp.fr"),
@@ -61,13 +54,8 @@ export async function generateMetadata({
languages, languages,
}, },
// Theme (mobile browser bar color) applicationName: t("title"),
themeColor: [
{ media: "(prefers-color-scheme: light)", color: "#ffffff" },
{ media: "(prefers-color-scheme: dark)", color: "#0a0a0a" },
],
// Icons / Favicons / PWA
icons: { icons: {
icon: [ icon: [
{ url: "/favicon.ico" }, { url: "/favicon.ico" },
@@ -79,33 +67,27 @@ export async function generateMetadata({
apple: "/apple-touch-icon.png", apple: "/apple-touch-icon.png",
}, },
// PWA / iOS App mode
appleWebApp: { appleWebApp: {
capable: true, capable: true,
title, title: t("title"),
statusBarStyle: "default", statusBarStyle: "default",
}, },
applicationName: title,
// OpenGraph (Discord / WhatsApp / Twitter preview)
openGraph: { openGraph: {
type: "website", type: "website",
locale, locale,
url: `/${locale}`, url: `/${locale}`,
title, title: t("title"),
description, description: t("description"),
siteName: title, siteName: t("title"),
}, },
// Twitter card
twitter: { twitter: {
card: "summary_large_image", card: "summary_large_image",
title, title: t("title"),
description, description: t("description"),
}, },
// SEO control
robots: { robots: {
index: true, index: true,
follow: true, follow: true,
@@ -113,22 +95,24 @@ export async function generateMetadata({
}; };
} }
/** /* ---------------- Viewport (UI/mobile only) ---------------- */
* Viewport (important mobile)
*/
export const viewport: Viewport = { export const viewport: Viewport = {
width: "device-width", width: "device-width",
initialScale: 1, initialScale: 1,
themeColor: "#ffffff", themeColor: [
{ media: "(prefers-color-scheme: light)", color: "#ffffff" },
{ media: "(prefers-color-scheme: dark)", color: "#0a0a0a" },
],
}; };
/* ---------------- Layout ---------------- */
export default async function LocaleLayout({ export default async function LocaleLayout({
children, children,
params, params,
}: Readonly<{ }: {
children: React.ReactNode; children: React.ReactNode;
params: Promise<{ locale: string }>; params: Promise<{ locale: string }>;
}>) { }) {
const { locale } = await params; const { locale } = await params;
if (!hasLocale(routing.locales, locale)) { if (!hasLocale(routing.locales, locale)) {