Merge branch 'hackathon' of https://github.com/UT-Developers/UT-Registration-Plus into hackathon
This commit is contained in:
@@ -58,56 +58,56 @@ const testData: CalendarGridCourse[] = [
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
calendarGridPoint: {
|
calendarGridPoint: {
|
||||||
dayIndex: 4,
|
dayIndex: 4,
|
||||||
startIndex: 10,
|
startIndex: 10,
|
||||||
endIndex: 11,
|
endIndex: 11,
|
||||||
},
|
},
|
||||||
componentProps: {
|
componentProps: {
|
||||||
courseDeptAndInstr: 'Course 1',
|
courseDeptAndInstr: 'Course 1',
|
||||||
timeAndLocation: '9:00 AM - 10:00 AM, Room 101',
|
timeAndLocation: '9:00 AM - 10:00 AM, Room 101',
|
||||||
status: Status.OPEN,
|
status: Status.OPEN,
|
||||||
colors: getCourseColors('emerald', 500),
|
colors: getCourseColors('emerald', 500),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
calendarGridPoint: {
|
calendarGridPoint: {
|
||||||
dayIndex: 1,
|
dayIndex: 1,
|
||||||
startIndex: 10,
|
startIndex: 10,
|
||||||
endIndex: 12,
|
endIndex: 12,
|
||||||
},
|
},
|
||||||
componentProps: {
|
componentProps: {
|
||||||
courseDeptAndInstr: 'Course 2',
|
courseDeptAndInstr: 'Course 2',
|
||||||
timeAndLocation: '10:00 AM - 11:00 AM, Room 102',
|
timeAndLocation: '10:00 AM - 11:00 AM, Room 102',
|
||||||
status: Status.CLOSED,
|
status: Status.CLOSED,
|
||||||
colors: getCourseColors('emerald', 500),
|
colors: getCourseColors('emerald', 500),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
calendarGridPoint: {
|
calendarGridPoint: {
|
||||||
dayIndex: 1,
|
dayIndex: 1,
|
||||||
startIndex: 10,
|
startIndex: 10,
|
||||||
endIndex: 12,
|
endIndex: 12,
|
||||||
},
|
},
|
||||||
componentProps: {
|
componentProps: {
|
||||||
courseDeptAndInstr: 'Course 3',
|
courseDeptAndInstr: 'Course 3',
|
||||||
timeAndLocation: '10:00 AM - 11:00 AM, Room 102',
|
timeAndLocation: '10:00 AM - 11:00 AM, Room 102',
|
||||||
status: Status.CLOSED,
|
status: Status.CLOSED,
|
||||||
colors: getCourseColors('emerald', 500),
|
colors: getCourseColors('emerald', 500),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
calendarGridPoint: {
|
calendarGridPoint: {
|
||||||
dayIndex: 1,
|
dayIndex: 1,
|
||||||
startIndex: 10,
|
startIndex: 10,
|
||||||
endIndex: 12,
|
endIndex: 12,
|
||||||
},
|
},
|
||||||
componentProps: {
|
componentProps: {
|
||||||
courseDeptAndInstr: 'Course 4',
|
courseDeptAndInstr: 'Course 4',
|
||||||
timeAndLocation: '10:00 AM - 11:00 AM, Room 102',
|
timeAndLocation: '10:00 AM - 11:00 AM, Room 102',
|
||||||
status: Status.CLOSED,
|
status: Status.CLOSED,
|
||||||
colors: getCourseColors('emerald', 500),
|
colors: getCourseColors('emerald', 500),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
@@ -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