Skip to content

Commit

Permalink
Add tooltip when hovering on search result name
Browse files Browse the repository at this point in the history
  • Loading branch information
AbhiramTadepalli committed Nov 10, 2024
1 parent b7d04a1 commit fa3b55c
Showing 1 changed file with 23 additions and 9 deletions.
32 changes: 23 additions & 9 deletions src/components/common/SearchResultsTable/searchResultsTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,15 +159,29 @@ function Row({
</Tooltip>
</TableCell>
<TableCell component="th" scope="row">
<Typography className="leading-tight text-lg text-gray-600 dark:text-gray-200">
{searchQueryLabel(course) +
((typeof course.profFirst === 'undefined' &&
typeof course.profLast === 'undefined') ||
(typeof course.prefix === 'undefined' &&
typeof course.number === 'undefined')
? ' (Overall)'
: '')}
</Typography>
<Tooltip
title={
rmp !== undefined && rmp.state === 'done'
? 'Tags: ' +
rmp.data.teacherRatingTags
.sort((a, b) => b.tagCount - a.tagCount)
.slice(0, 3)
.map((tag) => tag.tagName)
.join(', ')
: 'No Tags Available'
}
placement="top"
>
<Typography className="leading-tight text-lg text-gray-600 dark:text-gray-200">
{searchQueryLabel(course) +
((typeof course.profFirst === 'undefined' &&
typeof course.profLast === 'undefined') ||
(typeof course.prefix === 'undefined' &&
typeof course.number === 'undefined')
? ' (Overall)'
: '')}
</Typography>
</Tooltip>
</TableCell>
<TableCell align="right">
{((typeof grades === 'undefined' || grades.state === 'error') && (
Expand Down

0 comments on commit fa3b55c

Please sign in to comment.