Skip to content

Commit b55c185

Browse files
committed
Hide red text when manual flow is not toggled on
1 parent e63232c commit b55c185

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

course-matrix/frontend/src/pages/TimetableBuilder/Calendar.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ import { TimetableForm } from "@/models/timetable-form";
5454
import { getSemesterStartAndEndDates } from "@/utils/semester-utils";
5555

5656
interface CalendarProps {
57+
isChoosingSectionsManually: boolean;
5758
semester: string;
5859
selectedCourses: TimetableForm["courses"];
5960
newOfferingIds: number[];
@@ -81,7 +82,7 @@ function parseEvent(id: number, event: Event, calendarId: string) {
8182
}
8283

8384
const Calendar = React.memo<CalendarProps>(
84-
({ semester, selectedCourses, newOfferingIds, restrictions }) => {
85+
({ semester, selectedCourses, newOfferingIds, restrictions, isChoosingSectionsManually }) => {
8586
const form = useForm<z.infer<typeof TimetableFormSchema>>();
8687

8788
const navigate = useNavigate();
@@ -322,7 +323,7 @@ const Calendar = React.memo<CalendarProps>(
322323
<div>Your Timetable</div>
323324
{!isEditingTimetable ? (
324325
<Dialog>
325-
{!allOfferingSectionsHaveBeenSelected && (
326+
{isChoosingSectionsManually && !allOfferingSectionsHaveBeenSelected && (
326327
<p className="text-sm text-red-500 pr-2">
327328
Please select all LEC/TUT/PRA sections for your courses in
328329
order to save your timetable.
@@ -366,7 +367,7 @@ const Calendar = React.memo<CalendarProps>(
366367
</Dialog>
367368
) : (
368369
<>
369-
{!allOfferingSectionsHaveBeenSelected && (
370+
{isChoosingSectionsManually && !allOfferingSectionsHaveBeenSelected && (
370371
<p className="text-sm text-red-500 pr-2">
371372
Please select all LEC/TUT/PRA sections for your courses in
372373
order to save your timetable.

course-matrix/frontend/src/pages/TimetableBuilder/TimetableBuilder.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,7 @@ const TimetableBuilder = () => {
533533
</div>
534534
<div className="w-3/5">
535535
<Calendar
536+
isChoosingSectionsManually={isChoosingSectionsManually}
536537
semester={selectedSemester}
537538
selectedCourses={selectedCourses}
538539
newOfferingIds={offeringIds}

0 commit comments

Comments
 (0)