diff --git a/src/views/components/calendar/CalendarBottomBar.tsx b/src/views/components/calendar/CalendarBottomBar.tsx index 7b9831da..9a4b4141 100644 --- a/src/views/components/calendar/CalendarBottomBar.tsx +++ b/src/views/components/calendar/CalendarBottomBar.tsx @@ -3,6 +3,7 @@ import Text from '@views/components/common/Text/Text'; import { ColorPickerProvider } from '@views/contexts/ColorPickerContext'; import type { CalendarGridCourse } from '@views/hooks/useFlattenedCourseSchedule'; import clsx from 'clsx'; +import type { ReactNode } from 'react'; import React from 'react'; import CalendarCourseBlock from './CalendarCourseCell'; @@ -18,44 +19,38 @@ type CalendarBottomBarProps = { * @param courses - The list of courses to display in the calendar. * @returns The rendered bottom bar component. */ -export default function CalendarBottomBar({ courseCells, setCourse }: CalendarBottomBarProps): JSX.Element { +export default function CalendarBottomBar({ courseCells, setCourse }: CalendarBottomBarProps): ReactNode { const asyncCourseCells = courseCells?.filter(block => block.async); const displayCourses = asyncCourseCells && asyncCourseCells.length > 0; + if (!displayCourses) return null; + return (
-
- {displayCourses && ( - <> - - Async / Other - - - — - -
- - {asyncCourseCells.map(block => { - const { courseDeptAndInstr, status, className } = block.componentProps; - return ( - setCourse(block.course)} - blockData={block} - /> - ); - })} - -
- - )} +
+ + Async / Other + + + — + +
+ + {asyncCourseCells.map(block => { + const { courseDeptAndInstr, status, className } = block.componentProps; + return ( + setCourse(block.course)} + blockData={block} + /> + ); + })} + +
);