@@ -2,25 +2,9 @@ import React, { useCallback } from 'react';
22import { Link } from 'react-router-dom' ;
33import { Facebook , Twitter , Linkedin , Mail } from 'lucide-react' ;
44import logo from '../../assets/logo.png' ;
5+ import { handleNavigation } from '../../utils/navigation' ;
56
67const Footer : React . FC = ( ) => {
7- const handleNavClick = useCallback ( ( href : string , e : React . MouseEvent ) => {
8- if ( href . startsWith ( '#' ) ) {
9- e . preventDefault ( ) ;
10- const element = document . getElementById ( href . substring ( 1 ) ) ;
11- if ( element ) {
12- const headerOffset = 80 ;
13- const elementPosition = element . getBoundingClientRect ( ) . top ;
14- const offsetPosition = elementPosition + window . pageYOffset - headerOffset ;
15-
16- window . scrollTo ( {
17- top : offsetPosition ,
18- behavior : 'smooth'
19- } ) ;
20- }
21- }
22- } , [ ] ) ;
23-
248 return (
259 < footer className = "bg-dark-800 border-t border-white/10" >
2610 < div className = "container mx-auto px-4 py-12" >
@@ -45,17 +29,17 @@ const Footer: React.FC = () => {
4529 < h3 className = "font-display text-lg font-semibold text-white mb-4" > Quick Links</ h3 >
4630 < ul className = "space-y-2" >
4731 < li >
48- < Link to = "/#technology" onClick = { ( e ) => handleNavClick ( '/#technology' , e ) } className = "text-white/70 hover:text-white transition-colors" >
32+ < Link to = "/#technology" onClick = { ( e ) => handleNavigation ( '/#technology' , e ) } className = "text-white/70 hover:text-white transition-colors" >
4933 Technology
5034 </ Link >
5135 </ li >
5236 < li >
53- < Link to = "/#benefits" onClick = { ( e ) => handleNavClick ( '/#benefits' , e ) } className = "text-white/70 hover:text-white transition-colors" >
37+ < Link to = "/#benefits" onClick = { ( e ) => handleNavigation ( '/#benefits' , e ) } className = "text-white/70 hover:text-white transition-colors" >
5438 Benefits
5539 </ Link >
5640 </ li >
5741 < li >
58- < Link to = "/#integration" onClick = { ( e ) => handleNavClick ( '/#integration' , e ) } className = "text-white/70 hover:text-white transition-colors" >
42+ < Link to = "/#integration" onClick = { ( e ) => handleNavigation ( '/#integration' , e ) } className = "text-white/70 hover:text-white transition-colors" >
5943 Integration
6044 </ Link >
6145 </ li >
@@ -82,7 +66,7 @@ const Footer: React.FC = () => {
8266 </ Link >
8367 </ li >
8468 < li >
85- < Link to = "/#contact" onClick = { ( e ) => handleNavClick ( '/#contact' , e ) } className = "text-white/70 hover:text-white transition-colors" >
69+ < Link to = "/#contact" onClick = { ( e ) => handleNavigation ( '/#contact' , e ) } className = "text-white/70 hover:text-white transition-colors" >
8670 Contact
8771 </ Link >
8872 </ li >
0 commit comments