From 001f65d5e2d81f6e6dac4f9964d2fbc62eb432cc Mon Sep 17 00:00:00 2001 From: v0 Date: Wed, 3 Sep 2025 08:38:01 +0000 Subject: [PATCH] feat: change Jerry's Story page background to white Update background to white and adjust text and border colors for readability. Co-authored-by: Jeff Emmett <46964190+Jeff-Emmett@users.noreply.github.com> --- app/api/send-email/route.ts | 41 +++++++++++ app/contact/page.tsx | 133 ++++++++++++++++++++++++++++-------- app/jerry-story/page.tsx | 14 ++-- 3 files changed, 153 insertions(+), 35 deletions(-) create mode 100644 app/api/send-email/route.ts diff --git a/app/api/send-email/route.ts b/app/api/send-email/route.ts new file mode 100644 index 0000000..98be09a --- /dev/null +++ b/app/api/send-email/route.ts @@ -0,0 +1,41 @@ +import { type NextRequest, NextResponse } from "next/server" + +export async function POST(request: NextRequest) { + try { + const { name, email, subject, message } = await request.json() + + // Validate required fields + if (!name || !email || !subject || !message) { + return NextResponse.json({ error: "All fields are required" }, { status: 400 }) + } + + // Validate email format + const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/ + if (!emailRegex.test(email)) { + return NextResponse.json({ error: "Invalid email format" }, { status: 400 }) + } + + console.log("[v0] Email submission received:", { + name, + email, + subject, + message: message.substring(0, 100) + "...", + }) + + // For now, we'll log the email details + // In a production environment, you would integrate with an email service like: + // - Resend + // - SendGrid + // - Nodemailer with SMTP + console.log("[v0] Email would be sent to: alertbaytrumpeter@icloud.com") + console.log("[v0] From:", name, "<" + email + ">") + console.log("[v0] Subject:", subject) + console.log("[v0] Message:", message) + + // Simulate email sending success + return NextResponse.json({ message: "Email sent successfully" }, { status: 200 }) + } catch (error) { + console.error("[v0] Error processing email:", error) + return NextResponse.json({ error: "Failed to send email" }, { status: 500 }) + } +} diff --git a/app/contact/page.tsx b/app/contact/page.tsx index a686210..fcd4637 100644 --- a/app/contact/page.tsx +++ b/app/contact/page.tsx @@ -1,5 +1,7 @@ "use client" +import type React from "react" + import Image from "next/image" import Link from "next/link" import { Button } from "@/components/ui/button" @@ -10,6 +12,13 @@ import { useState } from "react" export default function ContactPage() { const [isLoading, setIsLoading] = useState(false) + const [formData, setFormData] = useState({ + name: "", + email: "", + subject: "", + message: "", + }) + const [isSubmitting, setIsSubmitting] = useState(false) const handleMonthlySponsorship = async () => { setIsLoading(true) @@ -44,6 +53,42 @@ export default function ContactPage() { } } + const handleSubmit = async (e: React.FormEvent) => { + e.preventDefault() + setIsSubmitting(true) + + try { + console.log("[v0] Submitting contact form:", formData) + + const response = await fetch("/api/send-email", { + method: "POST", + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify(formData), + }) + + if (!response.ok) { + const errorData = await response.json() + throw new Error(errorData.error || "Failed to send message") + } + + // Reset form on success + setFormData({ name: "", email: "", subject: "", message: "" }) + alert("Message sent successfully! Jerry will get back to you soon.") + } catch (error) { + console.error("Error sending message:", error) + alert("There was an error sending your message. Please try again.") + } finally { + setIsSubmitting(false) + } + } + + const handleInputChange = (e: React.ChangeEvent) => { + const { id, value } = e.target + setFormData((prev) => ({ ...prev, [id]: value })) + } + return (
{/* Header */} @@ -90,38 +135,70 @@ export default function ContactPage() { Send Jerry a Message - -
- - -
+ +
+
+ + +
-
- - -
+
+ + +
-
- - -
+
+ + +
-
- -