diff --git a/client/src/components/MainNavigationBar.vue b/client/src/components/MainNavigationBar.vue index ded491a4..05d23afd 100644 --- a/client/src/components/MainNavigationBar.vue +++ b/client/src/components/MainNavigationBar.vue @@ -32,8 +32,16 @@ function inLearningPath() { return route.path.startsWith('/learningpath/') || route.path.startsWith('/circle/'); } +function getLearningPathStringProp (prop: 'title' | 'slug'): string { + return inLearningPath() && learningPathStore.learningPath ? learningPathStore.learningPath[prop] : ''; +} + function learningPathName (): string { - return inLearningPath() && learningPathStore.learningPath ? learningPathStore.learningPath.title : ''; + return getLearningPathStringProp('title') +} + +function learninPathSlug (): string { + return getLearningPathStringProp('slug') } function backButtonUrl() { diff --git a/client/src/components/MobileMenu.vue b/client/src/components/MobileMenu.vue index 149e375e..93312cf1 100644 --- a/client/src/components/MobileMenu.vue +++ b/client/src/components/MobileMenu.vue @@ -2,15 +2,24 @@ import ItFullScreenModal from '@/components/ui/ItFullScreenModal.vue' import IconLogout from '@/components/icons/IconLogout.vue' import IconSettings from '@/components/icons/IconSettings.vue' +import {useRouter} from "vue-router"; + +const router = useRouter() const props = defineProps<{ show: boolean, user: object, - learningPathName: string + learningPathName: string, + learningPathSlug: string }>() const emits = defineEmits(['closemodal']) +const clickLink = (to: string) => { + router.push(to) + emits('closemodal') +} +