From 514fbc6081b8eb04a7b9e9fb94bc5c1c09ce4af5 Mon Sep 17 00:00:00 2001 From: DhruvArora-03 Date: Sat, 24 Feb 2024 21:05:22 -0600 Subject: [PATCH] fix: comment/fix build errors --- src/views/components/CourseCatalogMain.tsx | 2 +- src/views/components/PopupMain.tsx | 2 +- .../calendar/CalendarCourseCell/CalendarCourseCell.tsx | 3 ++- .../components/calendar/CalendarHeader/CalenderHeader.tsx | 2 +- src/views/components/common/CourseStatus/CourseStatus.tsx | 4 ++-- src/views/components/common/List/List.tsx | 4 ++-- src/views/components/injected/AutoLoad/AutoLoad.tsx | 3 ++- .../injected/CourseCatalogInjectedPopup/HeadingAndActions.tsx | 4 ++-- src/views/lib/CourseCatalogScraper.ts | 4 ++-- src/views/lib/openNewTabFromContentScript.ts | 2 +- 10 files changed, 16 insertions(+), 14 deletions(-) diff --git a/src/views/components/CourseCatalogMain.tsx b/src/views/components/CourseCatalogMain.tsx index 6fd944e6..a6109b86 100644 --- a/src/views/components/CourseCatalogMain.tsx +++ b/src/views/components/CourseCatalogMain.tsx @@ -17,7 +17,7 @@ import TableRow from './injected/TableRow/TableRow'; import TableSubheading from './injected/TableSubheading/TableSubheading'; interface Props { - support: SiteSupport.COURSE_CATALOG_DETAILS | SiteSupport.COURSE_CATALOG_LIST; + support: any; // SiteSupport.COURSE_CATALOG_DETAILS | SiteSupport.COURSE_CATALOG_LIST; } /** diff --git a/src/views/components/PopupMain.tsx b/src/views/components/PopupMain.tsx index 30db718c..849d9e6c 100644 --- a/src/views/components/PopupMain.tsx +++ b/src/views/components/PopupMain.tsx @@ -69,7 +69,7 @@ export default function PopupMain() { - + {/* */}
(
- + {/* */} ); diff --git a/src/views/components/common/CourseStatus/CourseStatus.tsx b/src/views/components/common/CourseStatus/CourseStatus.tsx index dd7fdf76..3dcad8aa 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/common/List/List.tsx b/src/views/components/common/List/List.tsx index 61275fac..a957b3e6 100644 --- a/src/views/components/common/List/List.tsx +++ b/src/views/components/common/List/List.tsx @@ -1,7 +1,7 @@ import { DragDropContext, Draggable, Droppable } from '@hello-pangea/dnd'; import type { ReactElement } from 'react'; import React, { useCallback, useState } from 'react'; -import { areEqual } from 'react-window'; +// import { areEqual } from 'react-window'; /* * Ctrl + f dragHandleProps on PopupCourseBlock.tsx for example implementation of drag handle (two lines of code) @@ -75,7 +75,7 @@ const Row: React.FC = React.memo(({ data: { items, gap }, index, style {provided => } ); -}, areEqual); +}); // areEqual); /** * `List` is a functional component that displays a course meeting. diff --git a/src/views/components/injected/AutoLoad/AutoLoad.tsx b/src/views/components/injected/AutoLoad/AutoLoad.tsx index 224ccba2..2c1741b8 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/components/injected/CourseCatalogInjectedPopup/HeadingAndActions.tsx b/src/views/components/injected/CourseCatalogInjectedPopup/HeadingAndActions.tsx index afb55b8a..a6a314e2 100644 --- a/src/views/components/injected/CourseCatalogInjectedPopup/HeadingAndActions.tsx +++ b/src/views/components/injected/CourseCatalogInjectedPopup/HeadingAndActions.tsx @@ -131,7 +131,7 @@ const HeadingAndActions: React.FC = ({ course, onClose, a
@@ -150,7 +150,7 @@ const HeadingAndActions: React.FC = ({ course, onClose, a {!courseAdded ? 'Add Course' : 'Remove Course'}
- + {/* */} ); }; diff --git a/src/views/lib/CourseCatalogScraper.ts b/src/views/lib/CourseCatalogScraper.ts index 6d881a48..046ce57f 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'); diff --git a/src/views/lib/openNewTabFromContentScript.ts b/src/views/lib/openNewTabFromContentScript.ts index 3d0f9e91..4e3ff0f8 100644 --- a/src/views/lib/openNewTabFromContentScript.ts +++ b/src/views/lib/openNewTabFromContentScript.ts @@ -18,7 +18,7 @@ const messenger = createMessenger('background'); export async function openTabFromContentScript(url: string) { // @ts-ignore messenger - .openNewTab({ url }) + .openNewTab(/* { url } */) .then(() => { console.log('New tab opened with URL:', url); })