Compare commits
2 Commits
67df2d95e9
...
6a42c52b58
| Author | SHA1 | Date | |
|---|---|---|---|
| 6a42c52b58 | |||
| 72c24e0cc6 |
@@ -1,34 +0,0 @@
|
||||
"use client";
|
||||
|
||||
export const dynamic = 'force-dynamic';
|
||||
|
||||
import React from 'react';
|
||||
|
||||
export default function GlobalError({
|
||||
error,
|
||||
reset,
|
||||
}: {
|
||||
error: Error & { digest?: string };
|
||||
reset: () => void;
|
||||
}) {
|
||||
return (
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charSet="utf-8" />
|
||||
<title>Erreur Système - Afrohub</title>
|
||||
</head>
|
||||
<body>
|
||||
<div style={{ textAlign: 'center', padding: '50px', fontFamily: 'sans-serif' }}>
|
||||
<h2>Erreur critique du serveur</h2>
|
||||
<p style={{ color: '#666', marginBottom: '20px' }}>Une erreur inattendue s'est produite.</p>
|
||||
<button
|
||||
onClick={() => reset()}
|
||||
style={{ padding: '10px 20px', cursor: 'pointer', backgroundColor: '#ef4444', color: 'white', border: 'none', borderRadius: '8px', fontWeight: 'bold' }}
|
||||
>
|
||||
Recharger l'application
|
||||
</button>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
}
|
||||
@@ -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,36 +34,28 @@ 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>
|
||||
);
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
"dev": "next dev -p 3000",
|
||||
"dev:admin": "npm run dev --prefix admin -- -p 3001",
|
||||
"all": "concurrently \"npm run dev\" \"npm run dev:admin\"",
|
||||
"build": "prisma generate && next build",
|
||||
"build": "prisma generate && next build && npm run build:admin",
|
||||
"build:admin": "npm install --prefix admin && prisma generate && npm run build --prefix admin",
|
||||
"start": "npx prisma migrate deploy && next start",
|
||||
"start:admin": "npm run start --prefix admin",
|
||||
|
||||
Reference in New Issue
Block a user