Compare commits
3 Commits
vinson/rep
...
dhruv/chan
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
514fbc6081 | ||
|
|
0dcf1f2c04 | ||
|
|
dee20c6523 |
@@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -10,9 +10,12 @@ import { handleOpenCalendar } from '@views/components/injected/CourseCatalogInje
|
||||
import useSchedules from '@views/hooks/useSchedules';
|
||||
import { openTabFromContentScript } from '@views/lib/openNewTabFromContentScript';
|
||||
import React from 'react';
|
||||
import { FaCalendarAlt, FaCog, FaRedo } from 'react-icons/fa'; // Added FaRedo for the refresh icon
|
||||
import { TestColors } from 'src/stories/components/PopupCourseBlock.stories';
|
||||
|
||||
import CalendarIcon from '~icons/material-symbols/calendar-month';
|
||||
import RefreshIcon from '~icons/material-symbols/refresh';
|
||||
import SettingsIcon from '~icons/material-symbols/settings';
|
||||
|
||||
/**
|
||||
* Renders the main popup component.
|
||||
* This component displays the main schedule, courses, and options buttons.
|
||||
@@ -50,7 +53,7 @@ export default function PopupMain() {
|
||||
style={{ backgroundColor: '#bf5700', borderRadius: '8px', padding: '8px' }}
|
||||
onClick={handleOpenCalendar}
|
||||
>
|
||||
<FaCalendarAlt color='white' />
|
||||
<CalendarIcon color='white' />
|
||||
</button>
|
||||
<button
|
||||
style={{
|
||||
@@ -62,11 +65,11 @@ export default function PopupMain() {
|
||||
}}
|
||||
onClick={handleOpenOptions}
|
||||
>
|
||||
<FaCog color='#C05621' />
|
||||
<SettingsIcon color='#C05621' />
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<Divider color='#E2E8F0' type='solid' style={{ margin: '1rem 0' }} />
|
||||
{/* <Divider color='#E2E8F0' type='solid' style={{ margin: '1rem 0' }} /> */}
|
||||
<div
|
||||
className='mb-4 rounded-lg bg-white p-2 text-left shadow-inner'
|
||||
style={{ backgroundColor: 'white', border: '1px solid #FBD38D', borderRadius: '0.5rem' }}
|
||||
@@ -152,7 +155,7 @@ export default function PopupMain() {
|
||||
<Text as='div' variant='mini'>
|
||||
DATA UPDATED ON: 12:00 AM 02/01/2024
|
||||
</Text>
|
||||
<FaRedo className='ml-2 h-4 w-4 text-gray-600' />
|
||||
<RefreshIcon className='ml-2 h-4 w-4 text-gray-600' />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import type { StatusType } from '@shared/types/Course';
|
||||
import { Status } from '@shared/types/Course';
|
||||
import Text from '@views/components/common/Text/Text';
|
||||
import clsx from 'clsx';
|
||||
@@ -15,7 +16,7 @@ import CancelledIcon from '~icons/material-symbols/warning';
|
||||
export interface CalendarCourseCellProps {
|
||||
courseDeptAndInstr: string;
|
||||
timeAndLocation?: string;
|
||||
status: Status;
|
||||
status: StatusType;
|
||||
colors: CourseColors;
|
||||
className?: string;
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ const CalendarHeader = () => (
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<Divider type='solid' />
|
||||
{/* <Divider type='solid' /> */}
|
||||
</div>
|
||||
);
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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<RowProps> = React.memo(({ data: { items, gap }, index, style
|
||||
{provided => <Item provided={provided} item={item} style={adjustedStyle} gap={gap} />}
|
||||
</Draggable>
|
||||
);
|
||||
}, areEqual);
|
||||
}); // areEqual);
|
||||
|
||||
/**
|
||||
* `List` is a functional component that displays a course meeting.
|
||||
|
||||
@@ -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<HTMLDivElement | null>(null);
|
||||
const [status, setStatus] = useState<AutoLoadStatus>(AutoLoadStatus.IDLE);
|
||||
const [status, setStatus] = useState<AutoLoadStatusType>(AutoLoadStatus.IDLE);
|
||||
|
||||
useEffect(() => {
|
||||
const portalContainer = document.createElement('div');
|
||||
|
||||
@@ -131,7 +131,7 @@ const HeadingAndActions: React.FC<HeadingAndActionProps> = ({ course, onClose, a
|
||||
</div>
|
||||
<div className='my-3 flex flex-wrap items-center gap-[15px]'>
|
||||
<Button variant='filled' color='ut-burntorange' icon={CalendarMonth} onClick={handleOpenCalendar} />
|
||||
<Divider type='solid' color='ut-offwhite' className='h-7' />
|
||||
{/* <Divider type='solid' color='ut-offwhite' className='h-7' /> */}
|
||||
<Button variant='outline' color='ut-blue' icon={Reviews} onClick={handleOpenRateMyProf}>
|
||||
RateMyProf
|
||||
</Button>
|
||||
@@ -150,7 +150,7 @@ const HeadingAndActions: React.FC<HeadingAndActionProps> = ({ course, onClose, a
|
||||
{!courseAdded ? 'Add Course' : 'Remove Course'}
|
||||
</Button>
|
||||
</div>
|
||||
<Divider />
|
||||
{/* <Divider /> */}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -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');
|
||||
|
||||
@@ -18,7 +18,7 @@ const messenger = createMessenger<MyMessages>('background');
|
||||
export async function openTabFromContentScript(url: string) {
|
||||
// @ts-ignore
|
||||
messenger
|
||||
.openNewTab({ url })
|
||||
.openNewTab(/* { url } */)
|
||||
.then(() => {
|
||||
console.log('New tab opened with URL:', url);
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user