From cb96f5583a3602336a18f763d1b27396bb58b8b0 Mon Sep 17 00:00:00 2001 From: amirmoghi3 Date: Tue, 11 Mar 2025 03:09:56 +0330 Subject: [PATCH] fix --- src/app/[locale]/contact-us/page.jsx | 281 +++++++++++++++++++++++++ src/components/ContactUs/index.jsx | 184 ++++++++-------- src/components/NavBar/index.jsx | 2 + src/messages/ar-OM.json | 76 ++++++- src/messages/en.json | 126 ++++++++--- src/view/Landing/components/Footer.jsx | 2 +- src/view/Landing/index.jsx | 1 + 7 files changed, 545 insertions(+), 127 deletions(-) create mode 100644 src/app/[locale]/contact-us/page.jsx diff --git a/src/app/[locale]/contact-us/page.jsx b/src/app/[locale]/contact-us/page.jsx new file mode 100644 index 0000000..b3f8809 --- /dev/null +++ b/src/app/[locale]/contact-us/page.jsx @@ -0,0 +1,281 @@ +"use client" + +import { Mailbox } from 'lucide-react' +import { Clock, Facebook, Globe, Instagram, Linkedin, Mail, MapPin, Phone, Send, Twitter } from 'lucide-react' +import { useLocale, useTranslations } from 'next-intl' +import Link from "next/link" +import { useState } from "react" +import { toast } from 'react-toastify' +import graphql from 'src/utils/graphql' + + +const gql = ` +mutation CreateMessage($data: MessageInput!) { + createMessage(data: $data) { + documentId + } +} +` +export default function ContactPage() { + const t = useTranslations('ContactUs') + const locale = useLocale() + + + const [formData, setFormData] = useState({ + name: "", + email: "", + subject: "", + message: "", + phone: "" + }) + const [isSubmitting, setIsSubmitting] = useState(false) + const [isSubmitted, setIsSubmitted] = useState(false) + + const handleChange = (e) => { + const { name, value } = e.target + setFormData(prev => ({ ...prev, [name]: value })) + } + + const handleSubmit = async (e) => { + e.preventDefault() + setIsSubmitting(true) + if (!formData.email || !formData.subject || !formData.message) { + toast.success("Compelete All Required fields") + setIsSubmitting(false) + return + } + // Simulate form submission + const res = await graphql(gql, { + data: { + ...formData + } + }) + + toast.success("Message sent successfully") + + setIsSubmitting(false) + + setFormData({ name: "", email: "", subject: "", message: "", phone: "" }) + } + + + return ( +
+ {/* Hero Section */} +
+
+
+

{t('pageTitle')}

+

+ {t('pageSubtitle')} +

+
+
+
+ +
+
+ {/* Contact Information */} +
+
+

{t('contactInfo.title')}

+

+ {t('contactInfo.description')} +

+
+ + {/* Contact Details */} +
+
+
+ +
+
+

{t('contactInfo.office.title')}

+

{t('contactInfo.office.address1')}

+

{t('contactInfo.office.address2')}

+

{t('contactInfo.office.address3')}

+

{t('contactInfo.office.postalCode')}

+
+
+ + +
+
+ +
+
+

{t('contactInfo.phone.title')}

+

{t('contactInfo.phone.number')}

+
+
+ +
+
+ +
+
+

{t('contactInfo.email.title')}

+

{t('contactInfo.email.address')}

+
+
+ +
+
+ +
+
+

{t('contactInfo.hours.title')}

+

{t('contactInfo.hours.weekdays')}

+

{t('contactInfo.hours.weekend')}

+
+
+
+ + {/* Social Media */} +
+

{t('social.title')}

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

{t('form.title')}

+ + +
+
+ + +
+ +
+ + +
+
+ + +
+ +
+ + +
+ +
+ +