diff --git a/frontend/src/assets/Contact-us.png b/frontend/src/assets/Contact-us.png new file mode 100644 index 00000000..91774990 Binary files /dev/null and b/frontend/src/assets/Contact-us.png differ diff --git a/frontend/src/assets/Contact-us1.png b/frontend/src/assets/Contact-us1.png new file mode 100644 index 00000000..9a1a04b6 Binary files /dev/null and b/frontend/src/assets/Contact-us1.png differ diff --git a/frontend/src/assets/Contact-us2.png b/frontend/src/assets/Contact-us2.png new file mode 100644 index 00000000..fb810221 Binary files /dev/null and b/frontend/src/assets/Contact-us2.png differ diff --git a/frontend/src/pages/ContactUs.tsx b/frontend/src/pages/ContactUs.tsx index 164138cb..dc5e0319 100644 --- a/frontend/src/pages/ContactUs.tsx +++ b/frontend/src/pages/ContactUs.tsx @@ -1,7 +1,10 @@ import axios from "axios"; -import { useState } from "react"; +import { useState, useEffect } from "react"; import toast from "react-hot-toast"; import bgHero from "../assets/bgHero.png"; +import formImage1 from "../assets/Contact-us.png"; +import formImage2 from "../assets/Contact-us1.png"; +import formImage3 from "../assets/Contact-us2.png"; function ContactUs() { const [name, setName] = useState(""); @@ -15,12 +18,28 @@ function ContactUs() { message: "", }); - document.title='Style Share | Reach us 📱' + const images = [formImage1, formImage2, formImage3]; + const [currentImageIndex, setCurrentImageIndex] = useState(0); + const [fadeTransition, setFadeTransition] = useState(true); + + document.title = 'Style Share | Reach us 📱'; + + useEffect(() => { + const intervalId = setInterval(() => { + setFadeTransition(false); + setTimeout(() => { + setCurrentImageIndex((prevIndex) => (prevIndex + 1) % images.length); + setFadeTransition(true); + }, 500); + }, 5000); + + return () => clearInterval(intervalId); + }, []); const handleSubmit = async (e: React.FormEvent) => { e.preventDefault(); console.log(name, email, subject, message); - // Basic validation + if (!name || !email || !subject || !message) { setError({ ...error, @@ -67,89 +86,90 @@ function ContactUs() { toast.error("An unexpected error occurred!"); } }; - return ( -
-
-
-
-

- Contact Us -

-
-
- - setName(e.target.value)} - required - /> -
-
- - setEmail(e.target.value)} - required - /> -
-
- - setSubject(e.target.value)} - required - /> -
-
- - -

- {error.message} -

-
-
- -
-
-
+ return ( +
+

+ Contact Us +

+
+
+
+
+ + setName(e.target.value)} + required + /> +
+
+ + setEmail(e.target.value)} + required + /> +
+
+ + setSubject(e.target.value)} + required + /> +
+
+ + +

+ {error.message} +

+
+
+ +
+
+
+
+ Contact Us
- ) + ); } -export default ContactUs \ No newline at end of file +export default ContactUs;