From 4b9cb521d8a621e33cf6aec86bbdf19a061964eb Mon Sep 17 00:00:00 2001 From: vishnuprasad2004 Date: Fri, 4 Oct 2024 22:25:19 +0530 Subject: [PATCH 1/3] bug:improved the feedback form UI issue #61 --- frontend/src/App.css | 14 +++++ frontend/src/components/ui/FeedbackForm.jsx | 69 ++++++++++++++++----- 2 files changed, 66 insertions(+), 17 deletions(-) diff --git a/frontend/src/App.css b/frontend/src/App.css index 9b6403be..7c90129c 100644 --- a/frontend/src/App.css +++ b/frontend/src/App.css @@ -16,4 +16,18 @@ body, 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; } \ No newline at end of file diff --git a/frontend/src/components/ui/FeedbackForm.jsx b/frontend/src/components/ui/FeedbackForm.jsx index 5f02be21..7e57a5f9 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,15 +19,20 @@ 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 handleSubmit = (e) => { e.preventDefault(); - console.log(`Name: ${name}, Email: ${email}, Feedback: ${feedback}`); + console.log(`Name: ${name}, Email: ${email}, Feedback: ${feedback}, rating: ${rating}`); setSubmitted(true); setTimeout(() => { setName(""); setEmail(""); setFeedback(""); + setRating(null); setSubmitted(false); }, 3000); }; @@ -42,10 +48,10 @@ const FeedbackForm = () => { className="lg:grid lg:grid-cols-2 lg:gap-8" >
-

- We Value Your Feedback +

+ We value Your Feedback!

-

+

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

@@ -58,34 +64,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 @@ -93,25 +101,52 @@ const FeedbackForm = () => { />
- + */}
+
+ {[...Array(totalStars)].map((star, index) => { + const currentRating = index + 1; + return ( + + ); + })} +
@@ -119,8 +154,8 @@ const FeedbackForm = () => { {submitted && ( Thank you for your feedback! From 4fc423e5fb16a700953b3e98e250f29a15fbc60c Mon Sep 17 00:00:00 2001 From: vishnuprasad2004 Date: Mon, 7 Oct 2024 19:31:35 +0530 Subject: [PATCH 2/3] aligned and centered --- frontend/src/components/ui/FeedbackForm.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/components/ui/FeedbackForm.jsx b/frontend/src/components/ui/FeedbackForm.jsx index 7e57a5f9..72926cd5 100644 --- a/frontend/src/components/ui/FeedbackForm.jsx +++ b/frontend/src/components/ui/FeedbackForm.jsx @@ -45,7 +45,7 @@ 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" >

From 38738779d6dfdd55af4c561ecf4d79731b218994 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 7 Oct 2024 14:44:33 +0000 Subject: [PATCH 3/3] docs(contributor): contrib-readme-action has updated readme --- README.md | 48 ++---------------------------------------------- 1 file changed, 2 insertions(+), 46 deletions(-) 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