the-tip-top-frontend/app/layout-client.tsx
soufiane 7febb137e9 feat: add SonarQube integration, cookie consent, and authentication improvements
- Add SonarQube configuration for code quality analysis
  - sonar-project.properties with TypeScript/Next.js settings
  - .sonarignore to exclude build artifacts and dependencies
  - npm run sonar script
  - Jenkins pipeline stages for SonarQube analysis and quality gate

- Implement cookie consent banner
  - New CookieConsent component with matching site colors
  - localStorage persistence for user choice
  - Accept/Reject buttons with proper styling
  - Link to cookies policy page

- Add strict authentication protection for game page
  - Redirect unauthenticated users to login from /jeux
  - Clean up redundant auth checks and UI elements
  - Preserve redirect parameter for post-login navigation

- Implement smart navigation with auth-aware redirects
  - "Jouer maintenant" button redirects based on auth status
  - "Participer au jeu" footer link with conditional routing
  - Authenticated users go to /jeux, others to /register

- UI improvements and cleanup
  - Remove "Voir les lots" button from homepage
  - Remove "Gestion des cookies" from footer
  - Remove "À propos" from footer navigation
  - Consistent design across components

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-21 01:23:50 +01:00

31 lines
842 B
TypeScript

"use client";
import { usePathname } from "next/navigation";
import Header from "@/components/Header";
import Footer from "@/components/Footer";
import CookieConsent from "@/components/CookieConsent";
export default function LayoutClient({ children }: { children: React.ReactNode }) {
const pathname = usePathname();
// Ne pas afficher Header/Footer dans l'espace admin et employé
const isAdminRoute = pathname?.startsWith("/admin");
const isEmployeRoute = pathname?.startsWith("/employe");
const isHomePage = pathname === "/";
if (isAdminRoute || isEmployeRoute) {
return <>{children}</>;
}
return (
<>
<Header />
<main className={isHomePage ? "flex-1" : "flex-1 container mx-auto px-4 py-6 sm:px-6 lg:px-8"}>
{children}
</main>
<Footer />
<CookieConsent />
</>
);
}