From c29760cccbc99d2d463663e89e51131ae967347d Mon Sep 17 00:00:00 2001 From: Tyler Hill Date: Thu, 31 Oct 2024 01:17:10 -0500 Subject: [PATCH 1/4] Fix jumping --- .../SearchResultsTable/searchResultsTable.tsx | 35 ++++++++++--------- .../common/SingleProfInfo/singleProfInfo.tsx | 29 ++++++++------- 2 files changed, 36 insertions(+), 28 deletions(-) diff --git a/src/components/common/SearchResultsTable/searchResultsTable.tsx b/src/components/common/SearchResultsTable/searchResultsTable.tsx index 27a01a61..9e5ba202 100644 --- a/src/components/common/SearchResultsTable/searchResultsTable.tsx +++ b/src/components/common/SearchResultsTable/searchResultsTable.tsx @@ -58,18 +58,21 @@ function LoadingRow() { - - + + - - - 4.00 + + + A+ - - + + @@ -116,9 +119,8 @@ function Row({ <> setOpen(!open)} // opens/closes the card by clicking anywhere on the row - sx={{ '& > *': { borderBottom: 'unset' } }} > - + e.stopPropagation() // prevents opening/closing the card when clicking on the compare checkbox } + className="border-b-0" > - + {searchQueryLabel(course) + ((typeof course.profFirst === 'undefined' && @@ -169,16 +172,16 @@ function Row({ : '')} - + {((typeof grades === 'undefined' || grades.state === 'error') && ( <> )) || (grades.state === 'loading' && ( - A + A+ )) || (grades.state === 'done' && ( @@ -187,7 +190,7 @@ function Row({ placement="top" > {gpaToLetterGrade(grades.data.gpa)} @@ -196,10 +199,10 @@ function Row({ )) || null} - + {((typeof rmp === 'undefined' || rmp.state === 'error') && <>) || (rmp.state === 'loading' && ( - + )) || diff --git a/src/components/common/SingleProfInfo/singleProfInfo.tsx b/src/components/common/SingleProfInfo/singleProfInfo.tsx index 5014f7d4..23556c47 100644 --- a/src/components/common/SingleProfInfo/singleProfInfo.tsx +++ b/src/components/common/SingleProfInfo/singleProfInfo.tsx @@ -17,29 +17,34 @@ function SingleProfInfo({ rmp }: Props) { return ( -

- -

+ +

5.0

+

Professor rating

-

- -

+ +

5.0

+

Difficulty

-

- -

+ +

1,000

+

Ratings given

-

- -

+ +

99%

+

Would take again

+ + +

Visit Rate My Professors

+
+
); } From 27840211abbf04911a3f19a502f15285c6a273cc Mon Sep 17 00:00:00 2001 From: Tyler Hill Date: Thu, 31 Oct 2024 12:04:24 -0500 Subject: [PATCH 2/4] Migrate to grid v2 --- .../common/SingleProfInfo/singleProfInfo.tsx | 22 +++++++++---------- src/pages/dashboard/index.tsx | 10 ++++----- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/components/common/SingleProfInfo/singleProfInfo.tsx b/src/components/common/SingleProfInfo/singleProfInfo.tsx index 23556c47..f2b77090 100644 --- a/src/components/common/SingleProfInfo/singleProfInfo.tsx +++ b/src/components/common/SingleProfInfo/singleProfInfo.tsx @@ -1,4 +1,4 @@ -import { Grid, Skeleton } from '@mui/material'; +import { Grid2 as Grid, Skeleton } from '@mui/material'; import Link from 'next/link'; import React from 'react'; @@ -16,31 +16,31 @@ function SingleProfInfo({ rmp }: Props) { if (rmp.state === 'loading') { return ( - +

5.0

Professor rating

- +

5.0

Difficulty

- +

1,000

Ratings given

- +

99%

Would take again

- +

Visit Rate My Professors

@@ -50,27 +50,27 @@ function SingleProfInfo({ rmp }: Props) { } return ( - +

{rmp.data.avgRating}

Professor rating

- +

{rmp.data.avgDifficulty}

Difficulty

- +

{rmp.data.numRatings.toLocaleString()}

Ratings given

- +

{rmp.data.wouldTakeAgainPercent.toFixed(0) + '%'}

Would take again

- + { contentComponent = ( <> - + { addChosenSessions={addChosenSessions} /> - + - + { removeFromCompare={removeFromCompare} /> - +
{tabs} From d2b751ca92b9f0f95b16434c5af0c1bca9af6b5f Mon Sep 17 00:00:00 2001 From: Tyler Hill Date: Fri, 8 Nov 2024 00:22:35 -0600 Subject: [PATCH 3/4] Fix for #291 --- src/components/common/SearchResultsTable/searchResultsTable.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/common/SearchResultsTable/searchResultsTable.tsx b/src/components/common/SearchResultsTable/searchResultsTable.tsx index 1521df7e..83c4f0bb 100644 --- a/src/components/common/SearchResultsTable/searchResultsTable.tsx +++ b/src/components/common/SearchResultsTable/searchResultsTable.tsx @@ -163,7 +163,7 @@ function Row({ onClick={ (e) => e.stopPropagation() // prevents opening/closing the card when clicking on the text } - className="leading-tight text-lg text-gray-600 dark:text-gray-200 cursor-text" + className="leading-tight text-lg text-gray-600 dark:text-gray-200 cursor-text w-fit" > {searchQueryLabel(course) + ((typeof course.profFirst === 'undefined' && From 05e9be9658235ce2cfa679fb6da9a258854b376b Mon Sep 17 00:00:00 2001 From: Tyler Hill Date: Sun, 10 Nov 2024 17:21:36 -0600 Subject: [PATCH 4/4] Better width solution --- .../common/SearchResultsTable/searchResultsTable.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/common/SearchResultsTable/searchResultsTable.tsx b/src/components/common/SearchResultsTable/searchResultsTable.tsx index 83c4f0bb..1bd9e3d0 100644 --- a/src/components/common/SearchResultsTable/searchResultsTable.tsx +++ b/src/components/common/SearchResultsTable/searchResultsTable.tsx @@ -66,9 +66,9 @@ function LoadingRow() { - A+ + A+