From 0dcae25b93f576e92c28c43a536874d011dfc4ac Mon Sep 17 00:00:00 2001 From: ishita778 <122644722+ishita778@users.noreply.github.com> Date: Tue, 18 Mar 2025 04:00:46 -0500 Subject: [PATCH] chore: removed extra space at calendar footer (#557) * chore: removed extra space at calendar footer * chore: fixed eslint issues * chore: changed return type to react node * chore: displaycourses true fixes and checks fixed * chore: prettier fix --- .../components/calendar/CalendarBottomBar.tsx | 61 +++++++++---------- 1 file changed, 28 insertions(+), 33 deletions(-) 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 (