ajout des page RGPD
This commit is contained in:
@@ -4,10 +4,13 @@ import { useState, useEffect } from 'react'
|
||||
import { motion, AnimatePresence } from 'framer-motion'
|
||||
import { Menu, X, Lock, Shield } from 'lucide-react'
|
||||
import Link from 'next/link'
|
||||
import { usePathname } from 'next/navigation'
|
||||
|
||||
export default function Header() {
|
||||
const [isScrolled, setIsScrolled] = useState(false)
|
||||
const [isMobileMenuOpen, setIsMobileMenuOpen] = useState(false)
|
||||
const pathname = usePathname()
|
||||
const isHomePage = pathname === '/'
|
||||
|
||||
useEffect(() => {
|
||||
const handleScroll = () => {
|
||||
@@ -25,6 +28,13 @@ export default function Header() {
|
||||
{ href: '#contact', label: 'Contact' },
|
||||
]
|
||||
|
||||
const getNavHref = (href: string) => {
|
||||
if (isHomePage) {
|
||||
return href
|
||||
}
|
||||
return `/${href}`
|
||||
}
|
||||
|
||||
return (
|
||||
<motion.header
|
||||
initial={{ y: -100 }}
|
||||
@@ -54,7 +64,7 @@ export default function Header() {
|
||||
{navItems.map((item, index) => (
|
||||
<motion.a
|
||||
key={item.href}
|
||||
href={item.href}
|
||||
href={getNavHref(item.href)}
|
||||
initial={{ opacity: 0, y: -20 }}
|
||||
animate={{ opacity: 1, y: 0 }}
|
||||
transition={{ delay: index * 0.1 }}
|
||||
@@ -65,7 +75,7 @@ export default function Header() {
|
||||
</motion.a>
|
||||
))}
|
||||
<motion.a
|
||||
href="#contact"
|
||||
href={getNavHref('#contact')}
|
||||
initial={{ opacity: 0, scale: 0.8 }}
|
||||
animate={{ opacity: 1, scale: 1 }}
|
||||
transition={{ delay: 0.5 }}
|
||||
@@ -100,7 +110,7 @@ export default function Header() {
|
||||
{navItems.map((item) => (
|
||||
<a
|
||||
key={item.href}
|
||||
href={item.href}
|
||||
href={getNavHref(item.href)}
|
||||
onClick={() => setIsMobileMenuOpen(false)}
|
||||
className="block text-gray-300 hover:text-security-accent font-medium transition-colors py-2"
|
||||
>
|
||||
@@ -108,7 +118,7 @@ export default function Header() {
|
||||
</a>
|
||||
))}
|
||||
<a
|
||||
href="#contact"
|
||||
href={getNavHref('#contact')}
|
||||
onClick={() => setIsMobileMenuOpen(false)}
|
||||
className="block w-full text-center px-6 py-3 bg-gradient-to-r from-security-accent to-green-500 text-black rounded-xl font-semibold mt-4"
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user