Compare commits

..

3 Commits

Author SHA1 Message Date
DhruvArora-03
514fbc6081 fix: comment/fix build errors 2024-02-24 21:05:22 -06:00
DhruvArora-03
0dcf1f2c04 Merge branch 'dhruv/fix-popup-main-icons' into dhruv/change-schedule-calendar-page 2024-02-24 20:59:27 -06:00
DhruvArora-03
dee20c6523 feat: fix icons on PopupMain 2024-02-24 20:52:28 -06:00
10 changed files with 23 additions and 18 deletions

View File

@@ -17,7 +17,7 @@ import TableRow from './injected/TableRow/TableRow';
import TableSubheading from './injected/TableSubheading/TableSubheading'; import TableSubheading from './injected/TableSubheading/TableSubheading';
interface Props { interface Props {
support: SiteSupport.COURSE_CATALOG_DETAILS | SiteSupport.COURSE_CATALOG_LIST; support: any; // SiteSupport.COURSE_CATALOG_DETAILS | SiteSupport.COURSE_CATALOG_LIST;
} }
/** /**

View File

@@ -10,9 +10,12 @@ import { handleOpenCalendar } from '@views/components/injected/CourseCatalogInje
import useSchedules from '@views/hooks/useSchedules'; import useSchedules from '@views/hooks/useSchedules';
import { openTabFromContentScript } from '@views/lib/openNewTabFromContentScript'; import { openTabFromContentScript } from '@views/lib/openNewTabFromContentScript';
import React from 'react'; 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 { 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. * Renders the main popup component.
* This component displays the main schedule, courses, and options buttons. * 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' }} style={{ backgroundColor: '#bf5700', borderRadius: '8px', padding: '8px' }}
onClick={handleOpenCalendar} onClick={handleOpenCalendar}
> >
<FaCalendarAlt color='white' /> <CalendarIcon color='white' />
</button> </button>
<button <button
style={{ style={{
@@ -62,11 +65,11 @@ export default function PopupMain() {
}} }}
onClick={handleOpenOptions} onClick={handleOpenOptions}
> >
<FaCog color='#C05621' /> <SettingsIcon color='#C05621' />
</button> </button>
</div> </div>
</div> </div>
<Divider color='#E2E8F0' type='solid' style={{ margin: '1rem 0' }} /> {/* <Divider color='#E2E8F0' type='solid' style={{ margin: '1rem 0' }} /> */}
<div <div
className='mb-4 rounded-lg bg-white p-2 text-left shadow-inner' className='mb-4 rounded-lg bg-white p-2 text-left shadow-inner'
style={{ backgroundColor: 'white', border: '1px solid #FBD38D', borderRadius: '0.5rem' }} style={{ backgroundColor: 'white', border: '1px solid #FBD38D', borderRadius: '0.5rem' }}
@@ -152,7 +155,7 @@ export default function PopupMain() {
<Text as='div' variant='mini'> <Text as='div' variant='mini'>
DATA UPDATED ON: 12:00 AM 02/01/2024 DATA UPDATED ON: 12:00 AM 02/01/2024
</Text> </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> </div>
</div> </div>

View File

@@ -1,3 +1,4 @@
import type { StatusType } from '@shared/types/Course';
import { Status } from '@shared/types/Course'; import { Status } from '@shared/types/Course';
import Text from '@views/components/common/Text/Text'; import Text from '@views/components/common/Text/Text';
import clsx from 'clsx'; import clsx from 'clsx';
@@ -15,7 +16,7 @@ import CancelledIcon from '~icons/material-symbols/warning';
export interface CalendarCourseCellProps { export interface CalendarCourseCellProps {
courseDeptAndInstr: string; courseDeptAndInstr: string;
timeAndLocation?: string; timeAndLocation?: string;
status: Status; status: StatusType;
colors: CourseColors; colors: CourseColors;
className?: string; className?: string;
} }

View File

@@ -52,7 +52,7 @@ const CalendarHeader = () => (
</div> </div>
</div> </div>
</div> </div>
<Divider type='solid' /> {/* <Divider type='solid' /> */}
</div> </div>
); );

View File

@@ -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 { StatusIcon } from '@shared/util/icons';
import clsx from 'clsx'; import clsx from 'clsx';
import React from 'react'; import React from 'react';
@@ -11,7 +11,7 @@ type SizeType = 'small' | 'mini';
* Props for CourseStatus * Props for CourseStatus
*/ */
export interface CourseStatusProps { export interface CourseStatusProps {
status: Status; status: StatusType;
size: SizeType; size: SizeType;
} }

View File

@@ -1,7 +1,7 @@
import { DragDropContext, Draggable, Droppable } from '@hello-pangea/dnd'; import { DragDropContext, Draggable, Droppable } from '@hello-pangea/dnd';
import type { ReactElement } from 'react'; import type { ReactElement } from 'react';
import React, { useCallback, useState } 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) * 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} />} {provided => <Item provided={provided} item={item} style={adjustedStyle} gap={gap} />}
</Draggable> </Draggable>
); );
}, areEqual); }); // areEqual);
/** /**
* `List` is a functional component that displays a course meeting. * `List` is a functional component that displays a course meeting.

View File

@@ -2,6 +2,7 @@ import type { ScrapedRow } from '@shared/types/Course';
import useInfiniteScroll from '@views/hooks/useInfiniteScroll'; import useInfiniteScroll from '@views/hooks/useInfiniteScroll';
import { CourseCatalogScraper } from '@views/lib/CourseCatalogScraper'; import { CourseCatalogScraper } from '@views/lib/CourseCatalogScraper';
import { SiteSupport } from '@views/lib/getSiteSupport'; import { SiteSupport } from '@views/lib/getSiteSupport';
import type { AutoLoadStatusType } from '@views/lib/loadNextCourseCatalogPage';
import { import {
AutoLoadStatus, AutoLoadStatus,
loadNextCourseCatalogPage, loadNextCourseCatalogPage,
@@ -22,7 +23,7 @@ type Props = {
*/ */
export default function AutoLoad({ addRows }: Props) { export default function AutoLoad({ addRows }: Props) {
const [container, setContainer] = useState<HTMLDivElement | null>(null); const [container, setContainer] = useState<HTMLDivElement | null>(null);
const [status, setStatus] = useState<AutoLoadStatus>(AutoLoadStatus.IDLE); const [status, setStatus] = useState<AutoLoadStatusType>(AutoLoadStatus.IDLE);
useEffect(() => { useEffect(() => {
const portalContainer = document.createElement('div'); const portalContainer = document.createElement('div');

View File

@@ -131,7 +131,7 @@ const HeadingAndActions: React.FC<HeadingAndActionProps> = ({ course, onClose, a
</div> </div>
<div className='my-3 flex flex-wrap items-center gap-[15px]'> <div className='my-3 flex flex-wrap items-center gap-[15px]'>
<Button variant='filled' color='ut-burntorange' icon={CalendarMonth} onClick={handleOpenCalendar} /> <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}> <Button variant='outline' color='ut-blue' icon={Reviews} onClick={handleOpenRateMyProf}>
RateMyProf RateMyProf
</Button> </Button>
@@ -150,7 +150,7 @@ const HeadingAndActions: React.FC<HeadingAndActionProps> = ({ course, onClose, a
{!courseAdded ? 'Add Course' : 'Remove Course'} {!courseAdded ? 'Add Course' : 'Remove Course'}
</Button> </Button>
</div> </div>
<Divider /> {/* <Divider /> */}
</div> </div>
); );
}; };

View File

@@ -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 { Course, Status } from '@shared/types/Course';
import { CourseSchedule } from '@shared/types/CourseSchedule'; import { CourseSchedule } from '@shared/types/CourseSchedule';
import Instructor from '@shared/types/Instructor'; import Instructor from '@shared/types/Instructor';
@@ -278,7 +278,7 @@ export class CourseCatalogScraper {
* @param row the row of the course catalog table * @param row the row of the course catalog table
* @returns * @returns
*/ */
getStatus(row: HTMLTableRowElement): [status: Status, isReserved: boolean] { getStatus(row: HTMLTableRowElement): [status: StatusType, isReserved: boolean] {
const div = row.querySelector(TableDataSelector.STATUS); const div = row.querySelector(TableDataSelector.STATUS);
if (!div) { if (!div) {
throw new Error('Status not found'); throw new Error('Status not found');

View File

@@ -18,7 +18,7 @@ const messenger = createMessenger<MyMessages>('background');
export async function openTabFromContentScript(url: string) { export async function openTabFromContentScript(url: string) {
// @ts-ignore // @ts-ignore
messenger messenger
.openNewTab({ url }) .openNewTab(/* { url } */)
.then(() => { .then(() => {
console.log('New tab opened with URL:', url); console.log('New tab opened with URL:', url);
}) })