1- // Contact.jsx
2-
31import { useState } from "react" ;
42import { IoIosMail } from "react-icons/io" ;
53import { FaUser , FaPaperPlane , FaQuoteLeft , FaStar , FaHeadset } from "react-icons/fa" ;
6- import { HiOutlineSparkles } from "react-icons/hi" ;
74import axiosInstance from "../../utils/Axios" ;
85import useAlert from "../../utils/setAlert" ;
96
@@ -37,26 +34,11 @@ const Contact = () => {
3734
3835 try {
3936 await axiosInstance . post (
40- `${ import . meta . env . VITE_BACKEND_URL } /forms/contactDetails` ,
37+ `/forms/contactDetails` ,
4138 { details } ,
42- {
43- headers : {
44- 'Content-Type' : 'application/json'
45- }
46- }
4739 ) ;
48-
4940 handleSuccess ( "Thank you for contacting us, We will get back to you soon" ) ;
5041 setIsSuccess ( true ) ;
51- setDetails ( {
52- username : "" ,
53- gmail : "" ,
54- concern : "" ,
55- } ) ;
56-
57- // Reset success state after 3 seconds
58- setTimeout ( ( ) => setIsSuccess ( false ) , 3000 ) ;
59-
6042 } catch ( error ) {
6143 if ( error . response ?. status === 429 ) {
6244 handleError ( 'Rate limit exceeded. Please try again later.' ) ;
@@ -69,6 +51,11 @@ const Contact = () => {
6951 }
7052 } finally {
7153 setIsSubmitting ( false ) ;
54+ setDetails ( {
55+ username : "" ,
56+ gmail : "" ,
57+ concern : "" ,
58+ } ) ;
7259 }
7360 } ;
7461
@@ -93,7 +80,7 @@ const Contact = () => {
9380 Get in Touch
9481 </ h1 >
9582 < p className = "text-xl text-slate-600 max-w-2xl mx-auto leading-relaxed" >
96- Have a question or concern? We' re here to help. Send us a message and we' ll respond promptly.
83+ Have a question or concern? We' re here to help. Send us a message and we' ll respond promptly.
9784 </ p >
9885 </ div >
9986
@@ -106,13 +93,13 @@ const Contact = () => {
10693 < FaPaperPlane className = "w-10 h-10 text-green-600" />
10794 </ div >
10895 < h3 className = "text-2xl font-bold text-slate-800 mb-4" > Message Sent!</ h3 >
109- < p className = "text-slate-600" > Thank you for contacting us. We' ll get back to you soon.</ p >
96+ < p className = "text-slate-600" > Thank you for contacting us. We' ll get back to you soon.</ p >
11097 </ div >
11198 ) : (
11299 < div className = "space-y-8" >
113100 < div className = "text-center" >
114101 < h2 className = "text-3xl font-bold text-slate-800 mb-3" > Contact Us</ h2 >
115- < p className = "text-slate-600" > We' d love to hear from you</ p >
102+ < p className = "text-slate-600" > We' d love to hear from you</ p >
116103 </ div >
117104
118105 < form onSubmit = { handleSubmit } className = "space-y-6" >
@@ -254,7 +241,7 @@ const Contact = () => {
254241 < div className = "max-w-6xl mx-auto mb-16" >
255242 < div className = "text-center mb-12" >
256243 < h2 className = "text-3xl font-bold text-slate-800 mb-4" > Trusted Support</ h2 >
257- < p className = "text-slate-600" > We're here to help you succeed</ p >
244+ < p className = "text-slate-600" > { " We're here to help you succeed" } </ p >
258245 </ div >
259246
260247 < div className = "grid md:grid-cols-2 lg:grid-cols-3 gap-8" >
@@ -283,7 +270,7 @@ const Contact = () => {
283270 < div className = "md:col-span-2 lg:col-span-1 bg-white/60 backdrop-blur-sm rounded-2xl p-8 shadow-lg border border-slate-200/50 hover:shadow-xl transition-all duration-300" >
284271 < FaQuoteLeft className = "w-6 h-6 text-slate-400 mb-4" />
285272 < p className = "text-slate-700 mb-6 leading-relaxed" >
286- "Outstanding support! They resolved my issue quickly and professionally."
273+ { "Outstanding support! They resolved my issue quickly and professionally." }
287274 </ p >
288275 < div className = "flex items-center" >
289276 < div className = "w-10 h-10 bg-gradient-to-br from-slate-400 to-slate-600 rounded-full flex items-center justify-center text-white font-bold" >
0 commit comments