only front-end init

This commit is contained in:
Rustico77
2026-05-05 21:48:23 +00:00
parent ac76a80c7b
commit b32a70cd0e
53 changed files with 11684 additions and 206 deletions

View File

@@ -1,33 +1,43 @@
import type { Metadata } from "next";
import { Geist, Geist_Mono } from "next/font/google";
// app/layout.tsx
'use client';
import { usePathname } from 'next/navigation';
import { LanguageProvider } from "@/contexts/LanguageContext";
import { AdminProvider } from "@/contexts/AdminContext";
import { CartProvider } from "@/contexts/CartContext";
import CartDrawer from "@/components/CartDrawer";
import "./globals.css";
import Header from "@/components/Header";
import Footer from "@/components/Footer";
import { Toaster } from "sonner";
const geistSans = Geist({
variable: "--font-geist-sans",
subsets: ["latin"],
});
const geistMono = Geist_Mono({
variable: "--font-geist-mono",
subsets: ["latin"],
});
export const metadata: Metadata = {
title: "Create Next App",
description: "Generated by create next app",
};
export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
export default function RootLayout({ children }: { children: React.ReactNode }) {
const pathname = usePathname();
// Vérifier si on est sur une route admin
const isAdminRoute = pathname?.startsWith('/admin');
return (
<html
lang="en"
className={`${geistSans.variable} ${geistMono.variable} h-full antialiased`}
>
<body className="min-h-full flex flex-col">{children}</body>
<html>
<body>
<LanguageProvider>
<AdminProvider>
<CartProvider>
<Toaster position="top-right" richColors />
{/* Afficher Header seulement si ce n'est pas l'admin */}
{!isAdminRoute && <Header />}
{!isAdminRoute && <CartDrawer />}
{children}
{/* Afficher Footer seulement si ce n'est pas l'admin */}
{!isAdminRoute && <Footer />}
</CartProvider>
</AdminProvider>
</LanguageProvider>
</body>
</html>
);
}
}