From e1017e75703d0e135944cc58bd8fdd47d73f0cdd Mon Sep 17 00:00:00 2001 From: Sacha VAUDEY Date: Sat, 13 Sep 2025 18:57:09 +0200 Subject: [PATCH] clean --- .../components/layout/Navigation.tsx | 158 ++++++++++++++++++ banquise-website/eslint.config.js | 3 + 2 files changed, 161 insertions(+) create mode 100644 banquise-website/components/layout/Navigation.tsx create mode 100644 banquise-website/eslint.config.js diff --git a/banquise-website/components/layout/Navigation.tsx b/banquise-website/components/layout/Navigation.tsx new file mode 100644 index 0000000..2884a0b --- /dev/null +++ b/banquise-website/components/layout/Navigation.tsx @@ -0,0 +1,158 @@ +import React, { useState, useEffect } from 'react'; +import { MobileMenu } from './MobileMenu'; +import { URLS, SITE_CONFIG } from '@/lib/config/constants'; +import { commonStyles } from '@/lib/styles/components'; +import type { Translation } from '@/types/i18n'; + +interface NavigationProps { + translations: Translation['navigation']; + languageSwitcher: React.ReactElement; +} + +export const Navigation: React.FC = ({ translations, languageSwitcher }) => { + const [mobileMenuOpen, setMobileMenuOpen] = useState(false); + const [scrolled, setScrolled] = useState(false); + + useEffect(() => { + const handleScroll = () => { + const isScrolled = window.scrollY > 20; + setScrolled(isScrolled); + }; + window.addEventListener('scroll', handleScroll); + return () => window.removeEventListener('scroll', handleScroll); + }, []); + + useEffect(() => { + const handleResize = () => { + if (window.innerWidth >= 768) { + setMobileMenuOpen(false); + } + }; + window.addEventListener('resize', handleResize); + return () => window.removeEventListener('resize', handleResize); + }, []); + + return ( + <> + + + {/* Spacer pour compenser la navbar fixed */} +
+ + {/* Menu mobile */} + setMobileMenuOpen(false)} + translations={translations} + /> + + ); +}; diff --git a/banquise-website/eslint.config.js b/banquise-website/eslint.config.js new file mode 100644 index 0000000..957cd15 --- /dev/null +++ b/banquise-website/eslint.config.js @@ -0,0 +1,3 @@ +{ + "extends": ["next/core-web-vitals"] +}