Skip to content
Snippets Groups Projects
Commit 11d52429 authored by Michael Utama's avatar Michael Utama
Browse files

fix: missing report component after merge

parent 98ef1969
Branches
Tags
No related merge requests found
...@@ -3,10 +3,11 @@ import { ToastContainer, toast } from "react-toastify"; ...@@ -3,10 +3,11 @@ import { ToastContainer, toast } from "react-toastify";
import "react-toastify/dist/ReactToastify.css"; import "react-toastify/dist/ReactToastify.css";
import { FaWallet, FaStar } from "react-icons/fa6"; import { FaWallet, FaStar } from "react-icons/fa6";
import ReportModal from "./ReportModal"; import ReportModal from "./ReportModal";
import { useSearchParams } from "react-router-dom";
const Report = () => { const Report = () => {
const [report, setReport] = useState(""); const [searchParams, setSearchParams] = useSearchParams();
const [rating, setRating] = useState(0); const [report, setReport] = useState(searchParams.get('desc') || '');
const [popUp, setPopUp] = useState(false); const [popUp, setPopUp] = useState(false);
const handleReportValid = () => { const handleReportValid = () => {
...@@ -27,11 +28,7 @@ const Report = () => { ...@@ -27,11 +28,7 @@ const Report = () => {
toast.error("Oops! Something went wrong. 😭"); toast.error("Oops! Something went wrong. 😭");
}; };
const isReportValid = report.length > 0 && rating > 0; const isReportValid = report.length > 0;
const handleStarClick = (selectedRating) => {
setRating(selectedRating);
};
return ( return (
<> <>
...@@ -40,23 +37,13 @@ const Report = () => { ...@@ -40,23 +37,13 @@ const Report = () => {
<div className="text-center text-white rounded-lg bg-[radial-gradient(ellipse_at_top,_var(--tw-gradient-stops))] from-darkgreen via-lightgreen to-verylightgreen p-4"> <div className="text-center text-white rounded-lg bg-[radial-gradient(ellipse_at_top,_var(--tw-gradient-stops))] from-darkgreen via-lightgreen to-verylightgreen p-4">
<h1 className="font-bold text-4xl">Report</h1> <h1 className="font-bold text-4xl">Report</h1>
</div> </div>
<div className="mt-4 flex items-center justify-center p-5 max-w-screen-2xl">
<div className="mb-4 flex flex-row items-center text-8xl">
{[1, 2, 3, 4, 5].map((star) => (
<FaStar
key={star}
className={star <= rating ? "text-yellow" : "text-gray"}
onClick={() => handleStarClick(star)}
/>
))}
</div>
</div>
<div className="rounded-xl border border-darkgreen mt-4 shadow-lg flex wrap md:flex-col flex-col my-0 mx-auto p-5 max-w-screen-2xl"> <div className="rounded-xl border border-darkgreen mt-4 shadow-lg flex wrap md:flex-col flex-col my-0 mx-auto p-5 max-w-screen-2xl">
<h1 className="text-4xl font-semibold mb-2">Tell Us Your Feedback</h1> <h1 className="text-4xl font-semibold mb-2">Tell Us Your Feedback</h1>
<div className="mb-4"> <div className="mb-4">
<label> <label>
<input <input
type="text" type="text"
value={report}
onChange={(e) => { onChange={(e) => {
setReport(e.target.value); setReport(e.target.value);
}} }}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment