diff --git a/src/lib/components/Course/components/Navigation/index.svelte b/src/lib/components/Course/components/Navigation/index.svelte index 9f73725a..4d5ca318 100644 --- a/src/lib/components/Course/components/Navigation/index.svelte +++ b/src/lib/components/Course/components/Navigation/index.svelte @@ -172,7 +172,7 @@ --> -
+
{#each navItems as navItem} {#if !navItem.show || (typeof navItem.show === 'function' && navItem.show())} {item.title} + {#if !item.is_unlocked} diff --git a/src/lib/components/Icons/CourseIcon.svelte b/src/lib/components/Icons/CourseIcon.svelte index da815d27..2734037b 100644 --- a/src/lib/components/Icons/CourseIcon.svelte +++ b/src/lib/components/Icons/CourseIcon.svelte @@ -1,3 +1,7 @@ + + diff --git a/src/lib/components/Navigation/app.svelte b/src/lib/components/Navigation/app.svelte index 425d2e67..bd672d4e 100644 --- a/src/lib/components/Navigation/app.svelte +++ b/src/lib/components/Navigation/app.svelte @@ -4,11 +4,14 @@ import NotificationIcon from 'carbon-icons-svelte/lib/Notification.svelte'; import Moon from 'carbon-icons-svelte/lib/Moon.svelte'; import Sun from 'carbon-icons-svelte/lib/Sun.svelte'; + import CourseIcon from '$lib/components/Icons/CourseIcon.svelte'; import IconButton from '$lib/components/IconButton/index.svelte'; + import { course } from '$lib/components/Course/store'; import { appStore } from '$lib/utils/store/app'; import { currentOrgPath } from '$lib/utils/store/org'; import { toggleBodyByTheme } from '$lib/utils/functions/app'; + import { goto } from '$app/navigation'; export let title = ''; export let navClass = ''; @@ -24,23 +27,34 @@ } } - function getPathName(_isCoursePage) { + function getPathName(_isCoursePage = false) { if (!_isCoursePage) { - return $currentOrgPath ?? '/'; + return '/'; } - return $currentOrgPath ? `${$currentOrgPath}/courses` : ''; + return $course.slug ? `${$page.url.host}/course/${$course.slug}` : `${$currentOrgPath}/courses`; }