Skip to content

Commit

Permalink
fix: set static titles for upcoming courseware (#1245)
Browse files Browse the repository at this point in the history
  • Loading branch information
brobro10000 authored Jan 7, 2025
1 parent 2cb1419 commit a8094f0
Showing 1 changed file with 13 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,18 @@ const BaseCourseCard = ({

const isExecutiveEducation2UCourse = EXECUTIVE_EDUCATION_COURSE_MODES.includes(mode);

const CourseTitleComponent = externalCourseLink ? Hyperlink : Link;
const renderCourseTitle = () => {
const courseTitleComponentProps = {
className: classNames('h3 mb-0', { 'text-white': isExecutiveEducation2UCourse }),
};
if (type === COURSE_STATUSES.upcoming) {
return <div {...courseTitleComponentProps}>{title}</div>;
}
if (externalCourseLink) {
return <Hyperlink destination={linkToCourse} {...courseTitleComponentProps}>{title}</Hyperlink>;
}
return <Link to={linkToCourse} {...courseTitleComponentProps}>{title}</Link>;
};

const getCoursePaceHyperlink = (chunks) => (
<Hyperlink
Expand Down Expand Up @@ -583,13 +594,7 @@ const BaseCourseCard = ({
>
<h4 className="course-title mt-n1 mb-0">
{renderMicroMastersTitle()}
<CourseTitleComponent
className={classNames('h3 mb-0', { 'text-white': isExecutiveEducation2UCourse })}
destination={externalCourseLink ? linkToCourse : null}
to={!externalCourseLink ? linkToCourse : null}
>
{title}
</CourseTitleComponent>
{renderCourseTitle()}
</h4>
{renderBadge()}
</Stack>
Expand Down

0 comments on commit a8094f0

Please sign in to comment.