diff --git a/README.md b/README.md index 7d21c673..42d32dbd 100644 --- a/README.md +++ b/README.md @@ -104,13 +104,6 @@ Special thanks to our amazing mentors who are guiding this project! 🙌 Samarth Vaidya - - - 17arindam -
- Arindam -
- tejasbenibagde @@ -131,15 +124,6 @@ Special thanks to our amazing mentors who are guiding this project! 🙌
Sajal Batra
- - - - - - AbhijitMotekar99 -
- Abhijit Motekar -
@@ -148,20 +132,8 @@ Special thanks to our amazing mentors who are guiding this project! 🙌 Mahera Nayan - - - Navneetdadhich -
- Navneet Dadhich -
- - - - Ayush215mb -
- Ayush Yadav -
- + + mishradev1 @@ -169,22 +141,6 @@ Special thanks to our amazing mentors who are guiding this project! 🙌 Dev Mishra - - - MutiatBash -
- Bashua Mutiat -
- - - - - - Sapna127 -
- Sapna Kul -
- Syed-Farazuddin diff --git a/frontend/src/App.css b/frontend/src/App.css index 0b19fafc..70f99181 100644 --- a/frontend/src/App.css +++ b/frontend/src/App.css @@ -18,3 +18,16 @@ body{ background: #F1EADC; } +.rating-button { + @apply flex-grow bg-neutral-50 text-center p-2 rounded-md cursor-pointer select-none +} + +input[type="radio"] { + display: none; +} + +.star { + cursor: pointer; + font-size: 2rem; + margin-bottom: 0; +} diff --git a/frontend/src/components/ui/FeedbackForm.jsx b/frontend/src/components/ui/FeedbackForm.jsx index 620724f8..396fd658 100644 --- a/frontend/src/components/ui/FeedbackForm.jsx +++ b/frontend/src/components/ui/FeedbackForm.jsx @@ -2,6 +2,7 @@ import { useState } from "react"; import { motion } from "framer-motion"; import { useInView } from "react-intersection-observer"; import chess from "../../assets/img/chess.gif"; +import { FaStar } from "react-icons/fa6"; const FeedbackForm = () => { const { ref, inView } = useInView({ @@ -18,11 +19,28 @@ const FeedbackForm = () => { const [email, setEmail] = useState(""); const [feedback, setFeedback] = useState(""); const [submitted, setSubmitted] = useState(false); + + const [rating, setRating] = useState(null); + + const [hover, setHover] = useState(null); + const [totalStars, setTotalStars] = useState(5); const [error, setError] = useState(null); const [isLoading, setIsLoading] = useState(false); + const handleSubmit = async (e) => { e.preventDefault(); + + console.log(`Name: ${name}, Email: ${email}, Feedback: ${feedback}, rating: ${rating}`); + setSubmitted(true); + setTimeout(() => { + setName(""); + setEmail(""); + setFeedback(""); + setRating(null); + setSubmitted(false); + }, 3000); + setIsLoading(true); try { const response = await fetch(`${API_URL}/feedback/create`, { @@ -55,6 +73,7 @@ const FeedbackForm = () => { } finally { setIsLoading(false); } + }; return ( @@ -65,13 +84,13 @@ const FeedbackForm = () => { initial="hidden" animate={inView ? "visible" : "hidden"} variants={animationVariants} - className="lg:grid lg:grid-cols-2 lg:gap-8" + className="lg:grid lg:grid-cols-2 lg:gap-8 lg:items-center" >
-

- We Value Your Feedback +

+ We value Your Feedback!

-

+

Your thoughts help us improve. Share your experience and suggestions with us!

@@ -84,34 +103,36 @@ const FeedbackForm = () => {
-
-
+
+
- + */} setName(e.target.value)} required className="mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-[#004D43] focus:border-[#004D43]" />
- + */} setEmail(e.target.value)} required @@ -119,25 +140,52 @@ const FeedbackForm = () => { />
- + */}
+
+ {[...Array(totalStars)].map((star, index) => { + const currentRating = index + 1; + return ( + + ); + })} +
@@ -145,8 +193,8 @@ const FeedbackForm = () => { {submitted && ( Thank you for your feedback!