From 47ccf574ca4314b7364c72ff72ea9a3aff7b9866 Mon Sep 17 00:00:00 2001 From: Pheonix Date: Thu, 18 Jun 2026 20:15:45 +0530 Subject: [PATCH] created a contact-us page and linked in footer --- src/app/contactus/page.tsx | 281 +++++++++++++++++++++++++++++++ src/components/layout/Footer.tsx | 8 +- 2 files changed, 286 insertions(+), 3 deletions(-) create mode 100644 src/app/contactus/page.tsx diff --git a/src/app/contactus/page.tsx b/src/app/contactus/page.tsx new file mode 100644 index 00000000..41fe8719 --- /dev/null +++ b/src/app/contactus/page.tsx @@ -0,0 +1,281 @@ +'use client'; + +import { useState } from 'react'; +import { Mail, Clock, Send, CheckCircle } from 'lucide-react'; +import { siteConfig } from '@/config/siteConfig'; +import { MagneticText } from '@/components/ui/magnetic-text'; + +const subjectOptions = [ + { value: '', label: 'Select Subject' }, + { value: 'general', label: 'General Inquiry' }, + { value: 'support', label: 'Technical Support' }, + { value: 'feature', label: 'Feature Request' }, + { value: 'bug', label: 'Bug Report' }, + { value: 'partnership', label: 'Partnership / Collaboration' }, + { value: 'feedback', label: 'Feedback' }, + { value: 'other', label: 'Other' }, +]; + +export default function ContactUsPage() { + const [formData, setFormData] = useState({ + name: '', + email: '', + subject: '', + message: '', + }); + + const [isSubmitting, setIsSubmitting] = useState(false); + const [isSubmitted, setIsSubmitted] = useState(false); + const [error, setError] = useState(''); + + const handleChange = ( + e: React.ChangeEvent< + HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement + > + ) => { + setFormData({ ...formData, [e.target.name]: e.target.value }); + if (error) setError(''); + }; + + const handleSubmit = async (e: React.FormEvent) => { + e.preventDefault(); + + if ( + !formData.name || + !formData.email || + !formData.subject || + !formData.message + ) { + setError('Please fill in all required fields.'); + return; + } + + setIsSubmitting(true); + setError(''); + + try { + // TODO: Replace with real API call later + // Example: await fetch('/api/contact', { method: 'POST', body: JSON.stringify(formData) }); + + console.log('Contact form submitted:', formData); + + // Simulate API delay + await new Promise((resolve) => setTimeout(resolve, 1200)); + + setIsSubmitted(true); + setFormData({ name: '', email: '', subject: '', message: '' }); + } catch (err) { + setError('Something went wrong. Please try again later.'); + } finally { + setIsSubmitting(false); + } + }; + + const resetForm = () => { + setIsSubmitted(false); + setError(''); + }; + + return ( +
+ {/* Hero Section */} +
+
+ +

+ Have questions? Need help? Or want to collaborate? +
+ We’re here for you. +

+
+
+ +
+
+ {/* Contact Form */} +
+

Send us a message

+ + {isSubmitted ? ( +
+ +

Thank You!

+

+ Your message has been received. We’ll get back to you within + 24-48 hours. +

+ +
+ ) : ( +
+ {error && ( +
+ {error} +
+ )} + +
+
+ + +
+
+ + +
+
+ +
+ + +
+ +
+ +