Skip to content

Commit 3f11c05

Browse files
committed
Fix HeroSection Learn More link and update Header navigation
1 parent 2c1fa0b commit 3f11c05

File tree

4 files changed

+23
-29
lines changed

4 files changed

+23
-29
lines changed

src/components/home/HeroSection.tsx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
22
import { ArrowRight, PlugZap, UserPlus } from 'lucide-react';
33
import L1Image from '../../assets/L1.webp';
4-
import { scrollToContact } from '../../utils/navigation';
4+
import { scrollToContact, scrollToSection } from '../../utils/navigation';
55

66
const HeroSection: React.FC = () => {
77
const handleDemoClick = (e: React.MouseEvent) => {
@@ -14,6 +14,11 @@ const HeroSection: React.FC = () => {
1414
scrollToContact('partnership');
1515
};
1616

17+
const handleLearnMoreClick = (e: React.MouseEvent) => {
18+
e.preventDefault();
19+
scrollToSection('technology');
20+
};
21+
1722
return (
1823
<section className="relative pt-24 pb-20 md:pt-32 md:pb-24 bg-gradient-to-b from-dark-900 via-dark-800 to-dark-900 overflow-hidden">
1924
{/* Background elements */}
@@ -69,7 +74,11 @@ const HeroSection: React.FC = () => {
6974
<span className="inline-block px-3 py-1 text-xs font-medium bg-primary-500/20 text-primary-300 rounded-full">Zero Drag</span>
7075
<span className="inline-block px-3 py-1 text-xs font-medium bg-secondary-500/20 text-secondary-300 rounded-full">In-Drive Charging</span>
7176
</div>
72-
<a href="#technology" className="text-primary-400 hover:text-primary-300 text-sm font-medium inline-flex items-center">
77+
<a
78+
href="#technology"
79+
onClick={handleLearnMoreClick}
80+
className="text-primary-400 hover:text-primary-300 text-sm font-medium inline-flex items-center"
81+
>
7382
Learn more <ArrowRight size={14} className="ml-1" />
7483
</a>
7584
</div>

src/components/layout/Footer.tsx

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,9 @@ import React, { useCallback } from 'react';
22
import { Link } from 'react-router-dom';
33
import { Facebook, Twitter, Linkedin, Mail } from 'lucide-react';
44
import logo from '../../assets/logo.png';
5+
import { handleNavigation } from '../../utils/navigation';
56

67
const 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>

src/components/layout/Header.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@ import logo from '../../assets/logo.png';
66
import { handleNavigation } from '../../utils/navigation';
77

88
const navLinks = [
9-
{ name: 'Technology', href: '#technology' },
10-
{ name: 'Benefits', href: '#benefits' },
11-
{ name: 'Integration', href: '#integration' },
12-
{ name: 'Team', href: '#team' },
13-
{ name: 'FAQ', href: '#faq' },
9+
{ name: 'Technology', href: '/#technology' },
10+
{ name: 'Benefits', href: '/#benefits' },
11+
{ name: 'Integration', href: '/#integration' },
12+
{ name: 'Team', href: '/team' },
13+
{ name: 'Careers', href: '/careers' },
14+
{ name: 'FAQ', href: '/faq' },
1415
];
1516

1617
const Header: React.FC = () => {

stats.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)