diff --git a/src/views/components/CourseCatalogMain.tsx b/src/views/components/CourseCatalogMain.tsx index 6fd944e63..6550188a6 100644 --- a/src/views/components/CourseCatalogMain.tsx +++ b/src/views/components/CourseCatalogMain.tsx @@ -1,23 +1,22 @@ import type { Course, ScrapedRow } from '@shared/types/Course'; import React, { useEffect, useState } from 'react'; -import { useKeyPress } from '../hooks/useKeyPress'; -import useSchedules from '../hooks/useSchedules'; -import { CourseCatalogScraper } from '../lib/CourseCatalogScraper'; -import getCourseTableRows from '../lib/getCourseTableRows'; -import type { SiteSupport } from '../lib/getSiteSupport'; -import { populateSearchInputs } from '../lib/populateSearchInputs'; -import ExtensionRoot from './common/ExtensionRoot/ExtensionRoot'; -import AutoLoad from './injected/AutoLoad/AutoLoad'; -import CourseCatalogInjectedPopup from './injected/CourseCatalogInjectedPopup/CourseCatalogInjectedPopup'; -import CoursePopup from './injected/CoursePopupOld/CoursePopup'; -import RecruitmentBanner from './injected/RecruitmentBanner/RecruitmentBanner'; -import TableHead from './injected/TableHead'; -import TableRow from './injected/TableRow/TableRow'; -import TableSubheading from './injected/TableSubheading/TableSubheading'; +import AutoLoad from '@views/components/injected/AutoLoad/AutoLoad'; +import CourseCatalogInjectedPopup from '@views/components/injected/CourseCatalogInjectedPopup/CourseCatalogInjectedPopup'; +import RecruitmentBanner from '@views/components/injected/RecruitmentBanner/RecruitmentBanner'; +import TableHead from '@views/components/injected/TableHead'; +import TableRow from '@views/components/injected/TableRow/TableRow'; +import TableSubheading from '@views/components/injected/TableSubheading/TableSubheading'; +import { useKeyPress } from '@views/hooks/useKeyPress'; +import useSchedules from '@views/hooks/useSchedules'; +import { CourseCatalogScraper } from '@views/lib/CourseCatalogScraper'; +import getCourseTableRows from '@views/lib/getCourseTableRows'; +import type { SiteSupportType } from '@views/lib/getSiteSupport'; +import { populateSearchInputs } from '@views/lib/populateSearchInputs'; +import ExtensionRoot from '@views/components/common/ExtensionRoot/ExtensionRoot'; interface Props { - support: SiteSupport.COURSE_CATALOG_DETAILS | SiteSupport.COURSE_CATALOG_LIST; + support: Extract; } /** diff --git a/src/views/components/calendar/CalendarCourseCell/CalendarCourseCell.tsx b/src/views/components/calendar/CalendarCourseCell/CalendarCourseCell.tsx index a3a3475d0..f256d2f74 100644 --- a/src/views/components/calendar/CalendarCourseCell/CalendarCourseCell.tsx +++ b/src/views/components/calendar/CalendarCourseCell/CalendarCourseCell.tsx @@ -1,4 +1,4 @@ -import { Status } from '@shared/types/Course'; +import { Status, StatusType } from '@shared/types/Course'; import Text from '@views/components/common/Text/Text'; import clsx from 'clsx'; import React from 'react'; @@ -15,7 +15,7 @@ import CancelledIcon from '~icons/material-symbols/warning'; export interface CalendarCourseCellProps { courseDeptAndInstr: string; timeAndLocation?: string; - status: Status; + status: StatusType; colors: CourseColors; className?: string; } @@ -27,7 +27,7 @@ export interface CalendarCourseCellProps { * @param {CalendarCourseCellProps} props - The component props. * @param {string} props.courseDeptAndInstr - The course department and instructor. * @param {string} props.timeAndLocation - The time and location of the course. - * @param {Status} props.status - The status of the course. + * @param {StatusType} props.status - The status of the course. * @param {Colors} props.colors - The colors for styling the cell. * @param {string} props.className - Additional CSS class name for the cell. * @returns {JSX.Element} The rendered component. diff --git a/src/views/components/common/CourseStatus/CourseStatus.tsx b/src/views/components/common/CourseStatus/CourseStatus.tsx index dd7fdf76f..3dcad8aaa 100644 --- a/src/views/components/common/CourseStatus/CourseStatus.tsx +++ b/src/views/components/common/CourseStatus/CourseStatus.tsx @@ -1,4 +1,4 @@ -import type { Status } from '@shared/types/Course'; +import type { StatusType } from '@shared/types/Course'; import { StatusIcon } from '@shared/util/icons'; import clsx from 'clsx'; import React from 'react'; @@ -11,7 +11,7 @@ type SizeType = 'small' | 'mini'; * Props for CourseStatus */ export interface CourseStatusProps { - status: Status; + status: StatusType; size: SizeType; } diff --git a/src/views/components/injected/AutoLoad/AutoLoad.tsx b/src/views/components/injected/AutoLoad/AutoLoad.tsx index 224ccba2f..2c1741b8a 100644 --- a/src/views/components/injected/AutoLoad/AutoLoad.tsx +++ b/src/views/components/injected/AutoLoad/AutoLoad.tsx @@ -2,6 +2,7 @@ import type { ScrapedRow } from '@shared/types/Course'; import useInfiniteScroll from '@views/hooks/useInfiniteScroll'; import { CourseCatalogScraper } from '@views/lib/CourseCatalogScraper'; import { SiteSupport } from '@views/lib/getSiteSupport'; +import type { AutoLoadStatusType } from '@views/lib/loadNextCourseCatalogPage'; import { AutoLoadStatus, loadNextCourseCatalogPage, @@ -22,7 +23,7 @@ type Props = { */ export default function AutoLoad({ addRows }: Props) { const [container, setContainer] = useState(null); - const [status, setStatus] = useState(AutoLoadStatus.IDLE); + const [status, setStatus] = useState(AutoLoadStatus.IDLE); useEffect(() => { const portalContainer = document.createElement('div'); diff --git a/src/views/lib/CourseCatalogScraper.ts b/src/views/lib/CourseCatalogScraper.ts index 6d881a48a..046ce57fa 100644 --- a/src/views/lib/CourseCatalogScraper.ts +++ b/src/views/lib/CourseCatalogScraper.ts @@ -1,4 +1,4 @@ -import type { InstructionMode, ScrapedRow, Semester } from '@shared/types/Course'; +import type { InstructionMode, ScrapedRow, Semester, StatusType } from '@shared/types/Course'; import { Course, Status } from '@shared/types/Course'; import { CourseSchedule } from '@shared/types/CourseSchedule'; import Instructor from '@shared/types/Instructor'; @@ -278,7 +278,7 @@ export class CourseCatalogScraper { * @param row the row of the course catalog table * @returns */ - getStatus(row: HTMLTableRowElement): [status: Status, isReserved: boolean] { + getStatus(row: HTMLTableRowElement): [status: StatusType, isReserved: boolean] { const div = row.querySelector(TableDataSelector.STATUS); if (!div) { throw new Error('Status not found');