Merge version_3 into main
Merge version_3 into main
This commit was merged in pull request #7.
This commit is contained in:
@@ -10,8 +10,46 @@ import SocialProofOne from "@/components/sections/socialProof/SocialProofOne";
|
||||
import ContactFaq from "@/components/sections/contact/ContactFaq";
|
||||
import FooterBaseCard from "@/components/sections/footer/FooterBaseCard";
|
||||
import { Award, CheckCircle, MapPin, Phone, Sparkles, Star, ThumbsUp, Wrench, Leaf, Zap, Trash2 } from "lucide-react";
|
||||
import { useState } from "react";
|
||||
|
||||
export default function LandingPage() {
|
||||
const [formData, setFormData] = useState({
|
||||
name: "", email: "", phone: "", message: ""
|
||||
});
|
||||
const [submitting, setSubmitting] = useState(false);
|
||||
const [submitted, setSubmitted] = useState(false);
|
||||
|
||||
const handleQuoteSubmit = async (e: React.FormEvent) => {
|
||||
e.preventDefault();
|
||||
setSubmitting(true);
|
||||
|
||||
try {
|
||||
const response = await fetch("/api/quote", {
|
||||
method: "POST", headers: {
|
||||
"Content-Type": "application/json"},
|
||||
body: JSON.stringify(formData),
|
||||
});
|
||||
|
||||
if (response.ok) {
|
||||
setSubmitted(true);
|
||||
setFormData({ name: "", email: "", phone: "", message: "" });
|
||||
setTimeout(() => setSubmitted(false), 3000);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error("Error submitting quote:", error);
|
||||
} finally {
|
||||
setSubmitting(false);
|
||||
}
|
||||
};
|
||||
|
||||
const handleGetFreeQuote = () => {
|
||||
// Scroll to contact form
|
||||
const contactSection = document.getElementById("contact");
|
||||
if (contactSection) {
|
||||
contactSection.scrollIntoView({ behavior: "smooth" });
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<ThemeProvider
|
||||
defaultButtonVariant="icon-arrow"
|
||||
@@ -47,7 +85,7 @@ export default function LandingPage() {
|
||||
tagAnimation="slide-up"
|
||||
buttons={[
|
||||
{ text: "Call Now (606) 627-7450", href: "tel:6066277450" },
|
||||
{ text: "Get Free Quote", href: "#contact" }
|
||||
{ text: "Get Free Quote", onClick: handleGetFreeQuote }
|
||||
]}
|
||||
buttonAnimation="slide-up"
|
||||
imageSrc="http://img.b2bpic.net/free-photo/cheerful-gardener-planting-seedling_329181-20597.jpg"
|
||||
@@ -194,7 +232,7 @@ export default function LandingPage() {
|
||||
ctaTitle="Get Your Free Quote"
|
||||
ctaDescription="Contact M&B Complete Lawn Services today. Call us 24/7 or fill out our quick form."
|
||||
ctaButton={{
|
||||
text: "Call (606) 627-7450", href: "tel:6066277450"
|
||||
text: "Submit Quote Request", onClick: handleQuoteSubmit
|
||||
}}
|
||||
ctaIcon={Phone}
|
||||
faqs={[
|
||||
|
||||
Reference in New Issue
Block a user