fix: bugs
This commit is contained in:
@@ -119,7 +119,7 @@ function CalendarGrid({ courseCells, saturdayClass }: React.PropsWithChildren<Pr
|
||||
</div>
|
||||
))}
|
||||
{grid.map((row, rowIndex) => row)}
|
||||
{courseCells ? accountForCourseConflicts(courseCells) : null}
|
||||
{courseCells ? <AccountForCourseConflicts courseCells={courseCells}/> : null}
|
||||
{/* courseCells.map((block: CalendarGridCourse) => (
|
||||
<div
|
||||
key={`${block}`}
|
||||
@@ -142,7 +142,11 @@ function CalendarGrid({ courseCells, saturdayClass }: React.PropsWithChildren<Pr
|
||||
|
||||
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
|
||||
const days = courseCells.reduce((acc, cell: CalendarGridCourse) => {
|
||||
const { dayIndex } = cell.calendarGridPoint;
|
||||
@@ -199,6 +203,7 @@ function accountForCourseConflicts(courseCells: CalendarGridCourse[]): JSX.Eleme
|
||||
timeAndLocation={block.componentProps.timeAndLocation}
|
||||
status={block.componentProps.status}
|
||||
colors={block.componentProps.colors}
|
||||
onClick={}
|
||||
/>
|
||||
</div>
|
||||
));
|
||||
|
||||
@@ -9,7 +9,7 @@ import { openTabFromContentScript } from 'src/views/lib/openNewTabFromContentScr
|
||||
import { Course } from 'src/shared/types/Course';
|
||||
import { UserSchedule } from 'src/shared/types/UserSchedule';
|
||||
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 CloseIcon from '~icons/material-symbols/close';
|
||||
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}>
|
||||
Past Syllabi
|
||||
</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'}
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user