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"] +}