Skip to content

Commit

Permalink
feat: async course adding and async/other course block adjustments (#273
Browse files Browse the repository at this point in the history
)

* feat: we do al il check to move sat and 7 am classes to async

* feat: it is 5 am ohhhhh boy i could go for some mighty mo's rn

* feat: a derek

* feat: undo

* chore: lint

* chore: lint x2

* feat: horizontal line

* feat: dash changed to —

* feat: remove conditional centering if no timeAndLocation found

* style: his majestys style changes

* style: 2

* style: x3

* style: x4

* style: x5
  • Loading branch information
DereC4 authored Oct 7, 2024
1 parent da6d86c commit 668c8d0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
7 changes: 6 additions & 1 deletion src/views/components/calendar/CalendarBottomBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,12 @@ export default function CalendarBottomBar({ courseCells, setCourse }: CalendarBo
>
{displayCourses && (
<>
<Text variant='h4'>Async/Other:</Text>
<Text variant='p' className='text-ut-black'>
ASYNC./OTHER
</Text>
<Text variant='h4' className='text-gray-300'>
</Text>
<div className='inline-flex gap-2.5'>
{asyncCourseCells.map(block => {
const { courseDeptAndInstr, status, colors, className } = block.componentProps;
Expand Down
6 changes: 1 addition & 5 deletions src/views/components/calendar/CalendarCourseCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,7 @@ export default function CalendarCourseCell({
}}
onClick={onClick}
>
<div
className={clsx('flex flex-1 flex-col gap-0.25 overflow-hidden max-h-full', {
'self-center': !timeAndLocation,
})}
>
<div className={clsx('flex flex-1 flex-col gap-0.25 overflow-hidden max-h-full')}>
<Text
variant='h1-course'
as='p'
Expand Down
10 changes: 8 additions & 2 deletions src/views/hooks/useFlattenedCourseSchedule.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Course, StatusType } from '@shared/types/Course';
import type { CourseMeeting } from '@shared/types/CourseMeeting';
import { type CourseMeeting, DAY_MAP } from '@shared/types/CourseMeeting';
import type { UserSchedule } from '@shared/types/UserSchedule';
import type { CalendarCourseCellProps } from '@views/components/calendar/CalendarCourseCell';

Expand Down Expand Up @@ -68,7 +68,13 @@ export function useFlattenedCourseSchedule(): FlattenedCourseSchedule {
return processAsyncCourses({ courseDeptAndInstr, status, course });
}

return meetings.flatMap(meeting => processInPersonMeetings(meeting, courseDeptAndInstr, status, course));
return meetings.flatMap(meeting => {
if (meeting.days.includes(DAY_MAP.S) || meeting.startTime < 480) {
return processAsyncCourses({ courseDeptAndInstr, status, course });
}

return processInPersonMeetings(meeting, courseDeptAndInstr, status, course);
});
})
.sort(sortCourses);

Expand Down

0 comments on commit 668c8d0

Please sign in to comment.