Skip to content

Commit

Permalink
review modal form updated
Browse files Browse the repository at this point in the history
  • Loading branch information
wizhaaa committed Oct 17, 2024
1 parent c293c9a commit 2a60562
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 20 deletions.
14 changes: 6 additions & 8 deletions client/src/modules/Course/Components/Course.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,9 @@ export const Course = () => {
setSelectedClass(course)

// After getting valid course info, fetch reviews
const reviewsResponse = await axios.post(
'/api/courses/get-reviews',
{
courseId: course._id,
}
)
const reviewsResponse = await axios.post('/api/courses/get-reviews', {
courseId: course._id,
})
const reviews = reviewsResponse.data.result
// Convert date field of Review to JavaScript Date object
reviews.map((r: Review) => (r.date = r.date && new Date(r.date)))
Expand Down Expand Up @@ -229,8 +226,9 @@ export const Course = () => {
<div className={styles.overview}>
<div className={styles.classinfo}>
<h1
data-cy={`course-title-${selectedClass.classSub.toLowerCase()}-${selectedClass.classNum
}`}
data-cy={`course-title-${selectedClass.classSub.toLowerCase()}-${
selectedClass.classNum
}`}
>
{selectedClass.classTitle}
</h1>
Expand Down
14 changes: 3 additions & 11 deletions client/src/modules/Course/Components/ReviewModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -183,13 +183,13 @@ const ReviewModal = ({
options={majorOptions}
value={selectedMajors}
onChange={onMajorChange}
placeholder="Underwater Basket Weaving"
placeholder="Select Major"
/>
<SingleSelect
options={gradeoptions}
value={selectedGrade}
onChange={onGradeChange}
placeholder="B+"
placeholder="Grade Received"
/>
</div>
<div className={styles.textcol}>
Expand All @@ -201,20 +201,12 @@ const ReviewModal = ({
id="review-content"
placeholder={placeholdertext}
></textarea>
<div className={styles.tags}>
<span role="img" aria-label="tags-coming-soon">
{' '}
👀{' '}
</span>
coming soon ...
</div>
<button
className={styles.submitbutton}
onClick={handleSubmitReview}
disabled={!allowSubmit}
>
{' '}
Submit Review{' '}
Submit Review
</button>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion client/src/modules/Course/Styles/ReviewModal.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
width: 100%;
height: 100%;
max-width: 456px;
height: 225px;
height: 355px;
border-radius: 10px;
border: 0.5px solid #65acff;
padding: 12px 14px;
Expand Down

0 comments on commit 2a60562

Please sign in to comment.