diff --git a/src/pages/HomePage/sections/Hero.tsx b/src/pages/HomePage/sections/Hero.tsx index a380e39..a255267 100644 --- a/src/pages/HomePage/sections/Hero.tsx +++ b/src/pages/HomePage/sections/Hero.tsx @@ -1,23 +1,84 @@ // AUTO-GENERATED by per-section-migrate. Edit freely — Bob will treat this // file as the canonical source for the "hero" section. -import React from 'react'; +import React, { useState, useEffect } from 'react'; import HeroSplit from '@/components/sections/hero/HeroSplit'; import SectionErrorBoundary from "@/components/ui/SectionErrorBoundary"; +import Input from "@/components/ui/Input"; +import Textarea from "@/components/ui/Textarea"; export default function HeroSection(): React.JSX.Element { + const [isModalOpen, setIsModalOpen] = useState(false); + + useEffect(() => { + const handleClick = (e: MouseEvent) => { + const target = e.target as HTMLElement; + const link = target.closest('a'); + if (link && link.getAttribute('href') === '#quote') { + e.preventDefault(); + setIsModalOpen(true); + } + }; + document.addEventListener('click', handleClick); + return () => document.removeEventListener('click', handleClick); + }, []); + + const handleSubmit = (e: React.FormEvent) => { + e.preventDefault(); + const formData = new FormData(e.target as HTMLFormElement); + const name = formData.get('name'); + const phone = formData.get('phone'); + const details = formData.get('details'); + const message = `New Quote Request:%0A- Name: ${name}%0A- Phone: ${phone}%0A- Details: ${details}`; + window.open(`https://wa.me/15551234567?text=${message}`, '_blank'); + setIsModalOpen(false); + }; + return (
Fill out the details below and we'll get back to you via WhatsApp.
+ +