updated Course schema
This commit is contained in:
@@ -2,14 +2,35 @@ import { Serialized } from 'chrome-extension-toolkit';
|
|||||||
|
|
||||||
type CourseSchedule = {};
|
type CourseSchedule = {};
|
||||||
|
|
||||||
export class Course {
|
type Professor = {
|
||||||
id: number;
|
|
||||||
name: string;
|
name: string;
|
||||||
professor: string;
|
firstName?: string;
|
||||||
|
initial?: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
type InstructionMode = 'Online' | 'In Person' | 'Hybrid';
|
||||||
|
|
||||||
|
type Links = {
|
||||||
|
syllabi?: string;
|
||||||
|
textbook?: string;
|
||||||
|
rateMyProfessor?: string;
|
||||||
|
eCIS?: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
export class Course {
|
||||||
|
uniqueId: number;
|
||||||
|
number: string;
|
||||||
|
name: string;
|
||||||
|
department: string;
|
||||||
|
professor: Professor;
|
||||||
|
description?: string;
|
||||||
schedule: CourseSchedule;
|
schedule: CourseSchedule;
|
||||||
currentStatus: string;
|
currentStatus: string;
|
||||||
url: string;
|
url: string;
|
||||||
|
links: Links;
|
||||||
registerURL?: string;
|
registerURL?: string;
|
||||||
|
flags: string[];
|
||||||
|
instructionMode: InstructionMode;
|
||||||
|
|
||||||
constructor(course: Course | Serialized<Course>) {
|
constructor(course: Course | Serialized<Course>) {
|
||||||
Object.assign(this, course);
|
Object.assign(this, course);
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ export default function CourseCatalogMain({ support }: Props) {
|
|||||||
const [rows, setRows] = React.useState<HTMLTableRowElement[]>([]);
|
const [rows, setRows] = React.useState<HTMLTableRowElement[]>([]);
|
||||||
const [selectedCourse, setSelectedCourse] = React.useState<Course | null>(null);
|
const [selectedCourse, setSelectedCourse] = React.useState<Course | null>(null);
|
||||||
|
|
||||||
const isInfiniteScrollLoading = useInfiniteScroll(async () => {
|
const isScrolling = useInfiniteScroll(async () => {
|
||||||
console.log('infinite scroll');
|
console.log('infinite scroll');
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
@@ -38,7 +38,7 @@ export default function CourseCatalogMain({ support }: Props) {
|
|||||||
{rows.map(row => (
|
{rows.map(row => (
|
||||||
<TableRow row={row} />
|
<TableRow row={row} />
|
||||||
))}
|
))}
|
||||||
{isInfiniteScrollLoading && <div>Scrolling...</div>}
|
{isScrolling && <div>Scrolling...</div>}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user