fix: bugs
This commit is contained in:
@@ -119,7 +119,7 @@ function CalendarGrid({ courseCells, saturdayClass }: React.PropsWithChildren<Pr
|
|||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
{grid.map((row, rowIndex) => row)}
|
{grid.map((row, rowIndex) => row)}
|
||||||
{courseCells ? accountForCourseConflicts(courseCells) : null}
|
{courseCells ? <AccountForCourseConflicts courseCells={courseCells}/> : null}
|
||||||
{/* courseCells.map((block: CalendarGridCourse) => (
|
{/* courseCells.map((block: CalendarGridCourse) => (
|
||||||
<div
|
<div
|
||||||
key={`${block}`}
|
key={`${block}`}
|
||||||
@@ -142,7 +142,11 @@ function CalendarGrid({ courseCells, saturdayClass }: React.PropsWithChildren<Pr
|
|||||||
|
|
||||||
export default CalendarGrid;
|
export default CalendarGrid;
|
||||||
|
|
||||||
function accountForCourseConflicts(courseCells: CalendarGridCourse[]): JSX.Element[] {
|
interface AccountForCourseConflictsProps {
|
||||||
|
courseCells: CalendarGridCourse[];
|
||||||
|
}
|
||||||
|
|
||||||
|
function AccountForCourseConflicts({ courseCells }: AccountForCourseConflictsProps): JSX.Element[] {
|
||||||
// Groups by dayIndex to identify overlaps
|
// Groups by dayIndex to identify overlaps
|
||||||
const days = courseCells.reduce((acc, cell: CalendarGridCourse) => {
|
const days = courseCells.reduce((acc, cell: CalendarGridCourse) => {
|
||||||
const { dayIndex } = cell.calendarGridPoint;
|
const { dayIndex } = cell.calendarGridPoint;
|
||||||
@@ -199,6 +203,7 @@ function accountForCourseConflicts(courseCells: CalendarGridCourse[]): JSX.Eleme
|
|||||||
timeAndLocation={block.componentProps.timeAndLocation}
|
timeAndLocation={block.componentProps.timeAndLocation}
|
||||||
status={block.componentProps.status}
|
status={block.componentProps.status}
|
||||||
colors={block.componentProps.colors}
|
colors={block.componentProps.colors}
|
||||||
|
onClick={}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
));
|
));
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import { openTabFromContentScript } from 'src/views/lib/openNewTabFromContentScr
|
|||||||
import { Course } from 'src/shared/types/Course';
|
import { Course } from 'src/shared/types/Course';
|
||||||
import { UserSchedule } from 'src/shared/types/UserSchedule';
|
import { UserSchedule } from 'src/shared/types/UserSchedule';
|
||||||
import Add from '~icons/material-symbols/add';
|
import Add from '~icons/material-symbols/add';
|
||||||
import Minus from '~icons/material-symbols/minus';
|
import Remove from '~icons/material-symbols/remove';
|
||||||
import CalendarMonth from '~icons/material-symbols/calendar-month';
|
import CalendarMonth from '~icons/material-symbols/calendar-month';
|
||||||
import CloseIcon from '~icons/material-symbols/close';
|
import CloseIcon from '~icons/material-symbols/close';
|
||||||
import Copy from '~icons/material-symbols/content-copy';
|
import Copy from '~icons/material-symbols/content-copy';
|
||||||
@@ -137,7 +137,7 @@ const HeadingAndActions: React.FC<HeadingAndActionProps> = ({ course, onClose, a
|
|||||||
<Button variant='outline' color='ut-orange' icon={Description} onClick={handleOpenPastSyllabi}>
|
<Button variant='outline' color='ut-orange' icon={Description} onClick={handleOpenPastSyllabi}>
|
||||||
Past Syllabi
|
Past Syllabi
|
||||||
</Button>
|
</Button>
|
||||||
<Button variant='filled' color={!courseAdded ? 'ut-green' : 'ut-red'} icon={!courseAdded ? Add : Minus} onClick={handleAddOrRemoveCourse}>
|
<Button variant='filled' color={!courseAdded ? 'ut-green' : 'ut-red'} icon={!courseAdded ? Add : Remove} onClick={handleAddOrRemoveCourse}>
|
||||||
{!courseAdded ? 'Add Course' : 'Remove Course'}
|
{!courseAdded ? 'Add Course' : 'Remove Course'}
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user