Skip to content

Commit

Permalink
Show finish button on last page even if course finished for congrats …
Browse files Browse the repository at this point in the history
…page.
  • Loading branch information
myslaf committed Mar 11, 2024
1 parent 60b37b2 commit edfc7c3
Showing 1 changed file with 14 additions and 17 deletions.
31 changes: 14 additions & 17 deletions src/components/molecules/CourseTopNav/CourseTopNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -138,22 +138,6 @@ export const CourseTopNav: React.FC<CourseTopNavProps> = (props) => {
</Button>
);
}
if (isLast && !isFinished) {
return (
<Button
mode={"primary"}
onClick={() => {
if (onCourseFinished) {
onCourseFinished();
}
}}
aria-label={t("Course.finishCourse")}
disabled={allButtonsDisabled}
>
{t("Course.finishCourse")}
</Button>
);
}
if (!isFinished) {
return (
<Button
Expand All @@ -170,7 +154,20 @@ export const CourseTopNav: React.FC<CourseTopNavProps> = (props) => {
</Button>
);
}
return <></>;
return (
<Button
mode={"primary"}
onClick={() => {
if (onCourseFinished) {
onCourseFinished();
}
}}
aria-label={t("Course.finishCourse")}
disabled={allButtonsDisabled}
>
{t("Course.finishCourse")}
</Button>
);
}, [isFinished, t, onFinish, isLast, allButtonsDisabled]);

const renderNoteButton = React.useCallback(() => {
Expand Down

0 comments on commit edfc7c3

Please sign in to comment.