Skip to content

Commit 6199631

Browse files
committed
Ensure ContactSection CTAs and TeamPage navigation are up-to-date
1 parent 88a7ea3 commit 6199631

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

src/components/home/ContactSection.tsx

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React, { useState, useRef, useCallback, useEffect } from 'react';
22
import { Send, Rocket, Linkedin } from 'lucide-react';
33
import emailjs from '@emailjs/browser';
44
import { emailConfig, RATE_LIMIT_MS } from '../../config';
5+
import { scrollToContact as navigateToContactTab } from '../../utils/navigation';
56

67
interface FormState {
78
name: string;
@@ -107,14 +108,22 @@ const ContactSection: React.FC = () => {
107108
}
108109
}, [formState, lastSubmissionTime]);
109110

110-
const handleRequestFeasibilityStudy = useCallback(() => {
111-
setFormState(prev => ({...prev, inquiryType: 'integration'}));
112-
document.getElementById('inquiryType')?.scrollIntoView({behavior: 'smooth'});
111+
const handleRequestFeasibilityStudy = useCallback((e: React.MouseEvent) => {
112+
e.preventDefault();
113+
navigateToContactTab('integration');
113114
}, []);
114115

115-
const handleScheduleConsultation = useCallback(() => {
116-
setFormState(prev => ({...prev, inquiryType: 'technical'}));
117-
document.getElementById('inquiryType')?.scrollIntoView({behavior: 'smooth'});
116+
const handleScheduleConsultation = useCallback((e: React.MouseEvent) => {
117+
e.preventDefault();
118+
navigateToContactTab('technical');
119+
}, []);
120+
121+
useEffect(() => {
122+
const params = new URLSearchParams(window.location.hash.split('?')[1]);
123+
const inquiry = params.get('inquiryType');
124+
if (inquiry) {
125+
setFormState(prev => ({ ...prev, inquiryType: inquiry }));
126+
}
118127
}, []);
119128

120129
return (

0 commit comments

Comments
 (0)