diff --git a/my-app/src/views/ReviewView.jsx b/my-app/src/views/ReviewView.jsx index 6ae5d42..b57e551 100644 --- a/my-app/src/views/ReviewView.jsx +++ b/my-app/src/views/ReviewView.jsx @@ -1,284 +1,238 @@ import React, { useState, useRef, useEffect } from "react"; - - import RatingComponent from "../views/Components/RatingComponent.jsx"; export function ReviewView(props) { - const grades = ["🅰️", "B", "C", "D", "E", "F"]; - const {formData, setFormData} = props; - const [showGradeOptions, setShowGradeOptions] = useState(false); - const [showRecommendOptions, setShowRecommendOptions] = useState(false); - const gradeRef = useRef(null); - const recommendRef = useRef(null); - - - useEffect(() => { - function handleClickOutside(event) { - if (gradeRef.current && !gradeRef.current.contains(event.target)) { - setShowGradeOptions(false); - } - if (recommendRef.current && !recommendRef.current.contains(event.target)) { - setShowRecommendOptions(false); - } - } - - document.addEventListener("mousedown", handleClickOutside); - return () => { - document.removeEventListener("mousedown", handleClickOutside); - }; - }, []); - - - return ( -
Overall rating
-Overall Rating
+Difficulty Rating
+Professor Rating
+Grade:
+Recommend?
+Difficulty rating
-Professor rating
-Grade:
-{rev.userName}
++ Posted on {new Date(rev.timestamp).toLocaleDateString("en-US", { + month: "long", + day: "numeric", + year: "numeric", + })} +
+Overall Rating
+Difficulty Rating
+Professor Rating
+Professor
+{rev.professorName}
+Grade
+{rev.grade}
+Recommended
+{rev.recommend ? "Yes" : "No"}
+Review
+{rev.text}
+No reviews yet.
}Recommend?
-- Professor Name & Rating -
*/} -
- Professor Rating
-
- {rev.userName} - - ({new Date(rev.timestamp).toLocaleDateString()}) - -
- -
- Overall Rating
-
- Difficulty Rating
-
- Professor -
- {rev.professorName} -
- - -
- Professor Rating
-
- Grade -
- {rev.grade} -
- - -- Recommended -
- {rev.recommend ? "👍" : "👎"} -
- - -- Review -
- {rev.text} -
- - -No reviews
} -