fix: navigation

This commit is contained in:
Livio Bieri 2023-10-02 13:53:39 +02:00
parent fd885d7b5e
commit 13581389c0
1 changed files with 14 additions and 5 deletions

View File

@ -29,7 +29,7 @@ const {
inCourse,
inLearningPath,
inMediaLibrary,
inDueDates,
inAppointments,
} = useRouteLookups();
const { t } = useTranslation();
@ -49,6 +49,15 @@ const selectedCourseSessionTitle = computed(() => {
return courseSessionsStore.currentCourseSession?.title;
});
const appointmentsUrl = computed(() => {
const currentCourseSession = courseSessionsStore.currentCourseSession;
if (currentCourseSession) {
return `/course/${currentCourseSession.course.slug}/appointments`;
} else {
return `/appointments`;
}
});
onMounted(() => {
log.debug("MainNavigationBar mounted");
});
@ -167,12 +176,12 @@ onMounted(() => {
<div class="flex items-stretch justify-start space-x-8">
<router-link
v-if="userStore.loggedIn"
:to="`${''}/appointments`"
:to="appointmentsUrl"
data-cy="all-duedates-link"
class="nav-item-no-mobile"
:class="{ 'nav-item--active': inDueDates() }"
class="nav-item"
:class="{ 'nav-item--active': inAppointments() }"
>
<it-icon-media-library class="h-8 w-8" />
<it-icon-calendar-light class="h-8 w-8" />
</router-link>
<router-link