Skip to content

Commit

Permalink
feat: disable/some actions when no instructor (#319)
Browse files Browse the repository at this point in the history
  • Loading branch information
Samathingamajig authored Oct 17, 2024
1 parent f29e3ef commit 839f9c6
Showing 1 changed file with 20 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,12 @@ export default function HeadingAndActions({ course, activeSchedule, onClose }: H
const url = `https://utdirect.utexas.edu/apps/student/coursedocs/nlogon/?year=&semester=&department=${department}&course_number=${courseNumber}&course_title=&unique=&instructor_first=${firstName}&instructor_last=${lastName}&course_type=In+Residence&search=Search`;
openNewTab({ url });
}

// Show the course's syllabi when no instructors listed
if (instructors.length === 0) {
const url = `https://utdirect.utexas.edu/apps/student/coursedocs/nlogon/?year=&semester=&department=${department}&course_number=${courseNumber}&course_title=&unique=&instructor_first=&instructor_last=&course_type=In+Residence&search=Search`;
openNewTab({ url });
}
};

const handleAddOrRemoveCourse = async () => {
Expand Down Expand Up @@ -199,10 +205,22 @@ export default function HeadingAndActions({ course, activeSchedule, onClose }: H
}}
/>
<Divider size='1.75rem' orientation='vertical' />
<Button variant='outline' color='ut-blue' icon={Reviews} onClick={handleOpenRateMyProf}>
<Button
variant='outline'
color='ut-blue'
icon={Reviews}
onClick={handleOpenRateMyProf}
disabled={instructors.length === 0}
>
RateMyProf
</Button>
<Button variant='outline' color='ut-teal' icon={Mood} onClick={handleOpenCES}>
<Button
variant='outline'
color='ut-teal'
icon={Mood}
onClick={handleOpenCES}
disabled={instructors.length === 0}
>
CES
</Button>
<Button variant='outline' color='ut-orange' icon={Description} onClick={handleOpenPastSyllabi}>
Expand Down

0 comments on commit 839f9c6

Please sign in to comment.