diff --git a/src/frontend/js/widgets/SyllabusCourseRunsList/components/SyllabusAsideList/index.tsx b/src/frontend/js/widgets/SyllabusCourseRunsList/components/SyllabusAsideList/index.tsx index 95ed09e1b2..1d9dcce55a 100644 --- a/src/frontend/js/widgets/SyllabusCourseRunsList/components/SyllabusAsideList/index.tsx +++ b/src/frontend/js/widgets/SyllabusCourseRunsList/components/SyllabusAsideList/index.tsx @@ -108,28 +108,20 @@ export const SyllabusAsideList = ({ const showLanguages = CourseRunHelper.IsAllCourseRunsWithSameLanguages(courseRuns); + // If there are no runs to display at all, don't render anything + if (openedRuns.length <= 1 && otherRuns.length === 0) { + return null; + } + return ( <>

- {openedRuns.length === 1 ? ( - - ) : ( + {openedRuns.length > 1 ? ( + ) : ( + )}

- {openedRuns.length <= 1 && otherRuns.length === 0 && ( -
- {openedRuns.length === 0 ? ( -

- -

- ) : ( -

- -

- )} -
- )} {openedRuns.length > 1 && (
{courseRun.title &&

{StringHelper.capitalizeFirst(courseRun.title)}

}
- {!showLanguages && ( -
- -
- )}
{hasEndDate ? ( - + <> +
+ +
+
+ +
+
+ +
+
+ +
+ ) : ( )}