diff --git a/src/views/components/injected/CoursePopup2/CourseHeadingAndActions.tsx b/src/views/components/injected/CoursePopup2/CourseHeadingAndActions.tsx index 9aa62bd8..0e649a84 100644 --- a/src/views/components/injected/CoursePopup2/CourseHeadingAndActions.tsx +++ b/src/views/components/injected/CoursePopup2/CourseHeadingAndActions.tsx @@ -29,8 +29,9 @@ const CourseHeadingAndActions = ({ course, onClose }: CourseHeadingAndActionsPro const { courseName, department, number, uniqueId, instructors, flags, schedule } = course; const instructorString = instructors .map(instructor => { - const firstInitial = instructor.firstName.length > 0 ? `${instructor.firstName.charAt(0)}. ` : ''; - return `${firstInitial}${instructor.lastName}`; + const { firstName, lastName } = instructor; + if (firstName === '') return lastName; + return `${firstName} ${lastName}`; }) .join(', '); @@ -38,24 +39,31 @@ const CourseHeadingAndActions = ({ course, onClose }: CourseHeadingAndActionsPro navigator.clipboard.writeText(uniqueId.toString()); }; + const handleOpenRateMyProf = () => { + instructors.forEach(instructor => { + const { fullName } = instructor; + const url = `https://www.ratemyprofessors.com/search/professors/1255?q=${fullName}`; + window.open(url, '_blank')?.focus(); + }); + }; + return (
-
+
{courseName} ({department} {number}) - {/* need to do handlers */} -
+
+
-
- with {instructorString} + with {instructorString}
{flags.map(flag => ( @@ -83,7 +91,7 @@ const CourseHeadingAndActions = ({ course, onClose }: CourseHeadingAndActionsPro