rectification branch develop

This commit is contained in:
2026-05-09 12:23:26 +02:00
parent 67df2d95e9
commit 72c24e0cc6
2 changed files with 18 additions and 25 deletions

View File

@@ -1,15 +1,16 @@
import React from 'react';
import { DynamicProviders } from '../components/DynamicProviders';
import Script from 'next/script';
import Navbar from '../components/Navbar';
import Footer from '../components/Footer';
import { getSiteSettings } from '../lib/settings';
import { UserProvider } from '../components/UserProvider';
import AnalyticsTracker from '../components/AnalyticsTracker';
import CookieBanner from '../components/CookieBanner';
import { Metadata } from 'next';
import { Toaster } from 'react-hot-toast';
import { getSiteSettings } from '../lib/settings';
import { Inter, Playfair_Display } from 'next/font/google';
import './globals.css';
// 2. LA MAGIE EST ICI : On utilise un wrapper Client pour le no-SSR
const inter = Inter({
subsets: ['latin'],
variable: '--font-inter',
@@ -22,7 +23,7 @@ const playfair = Playfair_Display({
display: 'swap',
});
export const dynamic = 'force-dynamic'; // Restauration du nom standard
export const dynamic = 'force-dynamic';
export async function generateMetadata(): Promise<Metadata> {
const settings = await getSiteSettings();
@@ -33,37 +34,29 @@ export async function generateMetadata(): Promise<Metadata> {
alternates: {
canonical: '/',
},
icons: {
icon: '/favicon.png',
},
};
}
const isDev = process.env.NEXT_PUBLIC_APP_ENV === 'development';
const devBrandOverride: React.CSSProperties | undefined = isDev ? {
'--color-brand-50': '#fef2f2',
'--color-brand-100': '#fee2e2',
'--color-brand-200': '#fecaca',
'--color-brand-500': '#ef4444',
'--color-brand-600': '#dc2626',
'--color-brand-700': '#b91c1c',
'--color-brand-900': '#7f1d1d',
} as React.CSSProperties : undefined;
export default async function RootLayout({ children }: { children: React.ReactNode }) {
const settings = await getSiteSettings();
return (
<html lang="fr" className={`${inter.variable} ${playfair.variable}`} style={devBrandOverride} suppressHydrationWarning>
<html lang="fr" className={`${inter.variable} ${playfair.variable}`} suppressHydrationWarning>
<head>
<link rel="icon" type="image/png" href="/favicon.png" />
</head>
<body className="bg-gray-50 text-gray-900 antialiased min-h-screen flex flex-col font-sans" suppressHydrationWarning>
<DynamicProviders>
<UserProvider>
<Toaster position="top-right" />
<AnalyticsTracker />
<Navbar settings={settings} />
<main className="flex-grow">
{children}
</main>
<Footer settings={settings} />
</DynamicProviders>
<CookieBanner />
</UserProvider>
</body>
</html>
);
}
}