fix: navigation
This commit is contained in:
parent
fd885d7b5e
commit
13581389c0
|
|
@ -29,7 +29,7 @@ const {
|
||||||
inCourse,
|
inCourse,
|
||||||
inLearningPath,
|
inLearningPath,
|
||||||
inMediaLibrary,
|
inMediaLibrary,
|
||||||
inDueDates,
|
inAppointments,
|
||||||
} = useRouteLookups();
|
} = useRouteLookups();
|
||||||
|
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
@ -49,6 +49,15 @@ const selectedCourseSessionTitle = computed(() => {
|
||||||
return courseSessionsStore.currentCourseSession?.title;
|
return courseSessionsStore.currentCourseSession?.title;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const appointmentsUrl = computed(() => {
|
||||||
|
const currentCourseSession = courseSessionsStore.currentCourseSession;
|
||||||
|
if (currentCourseSession) {
|
||||||
|
return `/course/${currentCourseSession.course.slug}/appointments`;
|
||||||
|
} else {
|
||||||
|
return `/appointments`;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
log.debug("MainNavigationBar mounted");
|
log.debug("MainNavigationBar mounted");
|
||||||
});
|
});
|
||||||
|
|
@ -167,12 +176,12 @@ onMounted(() => {
|
||||||
<div class="flex items-stretch justify-start space-x-8">
|
<div class="flex items-stretch justify-start space-x-8">
|
||||||
<router-link
|
<router-link
|
||||||
v-if="userStore.loggedIn"
|
v-if="userStore.loggedIn"
|
||||||
:to="`${''}/appointments`"
|
:to="appointmentsUrl"
|
||||||
data-cy="all-duedates-link"
|
data-cy="all-duedates-link"
|
||||||
class="nav-item-no-mobile"
|
class="nav-item"
|
||||||
:class="{ 'nav-item--active': inDueDates() }"
|
: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>
|
||||||
|
|
||||||
<router-link
|
<router-link
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue