Skip to content

Commit 5679f22

Browse files
annelise-kohAnnelise Koh
andauthored
added clickable course code for bookmarked reviews (#364)
* added link icon and clickable course code to bookmarked reviews * Make bookmarked review titles clickable, added link icon * added clickable course code to card view of bookmarked reviews --------- Co-authored-by: Annelise Koh <afekoh1559@gmail.com>
1 parent d352688 commit 5679f22

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

frontend/src/components/UserBookmarkedReviews/UserBookmarkedReviews.tsx

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Review, Reviews, TabsType } from "@/types/api";
44
import Dropdown from "../Dropdown/Dropdown";
55
import { Dispatch, SetStateAction, useEffect, useState } from "react";
66
import Rating from "../Rating/Rating";
7-
import { BookmarkIcon } from "@heroicons/react/24/solid";
7+
import { BookmarkIcon, LinkIcon } from "@heroicons/react/24/solid";
88
import ToggleSwitch from "../ToggleSwitch/ToggleSwitch";
99
import Pagination from "../Pagination/Pagination";
1010
import { validatedReq } from "@/utils/request";
@@ -130,7 +130,14 @@ export default function UserBookmarkedReviews({
130130
>
131131
<div className='flex w-1/2 sm:w-full sm:flex-col sm:items-start items-center gap-2'>
132132
{/* Title */}
133-
<h1 className='font-bold text-xl'>{review.courseCode}</h1>
133+
<a
134+
href={`/course/${review.courseCode}`}
135+
className='flex items-center gap-2 font-bold hover:text-unilectives-blue/75 duration-150'
136+
>
137+
<LinkIcon className='w-5 h-5' />
138+
<span className='truncate'>{review.courseCode}</span>
139+
</a>
140+
134141
{/* Description */}
135142
<p className='text-unilectives-headings dark:text-gray-100 w-full truncate'>
136143
{!review.description ? "-" : review.description}
@@ -161,9 +168,15 @@ export default function UserBookmarkedReviews({
161168
>
162169
{/* Course courseCode + Ratings */}
163170
<div className='flex flex-wrap justify-between text-2xl'>
164-
<h1 className='font-bold block truncate'>
165-
{review.courseCode}
166-
</h1>
171+
<a
172+
href={`/course/${review.courseCode}`}
173+
className='font-bold hover:text-unilectives-blue/75 duration-150 truncate'
174+
>
175+
<div className='flex items-center gap-2'>
176+
<LinkIcon className='w-6 h-6' />
177+
<span className='block truncate'>{review.courseCode}</span>
178+
</div>
179+
</a>
167180
<div className='text-right'>
168181
{/* StarRating */}
169182
<div className='text-2xl inline'>

0 commit comments

Comments
 (0)