Fix profile sidebar on mobile

This commit is contained in:
Ramon Wenger 2024-11-18 16:48:15 +01:00
parent 2386b5207e
commit 72f7a7f68c
4 changed files with 21 additions and 7 deletions

View File

@ -1,7 +1,7 @@
<script setup lang="ts"> <script setup lang="ts">
import ItFullScreenModal from "@/components/ui/ItFullScreenModal.vue"; import ItFullScreenModal from "@/components/ui/ItFullScreenModal.vue";
import { useVVByLink } from "@/composables"; import { useVVByLink } from "@/composables";
import { SETTINGS_ROUTE } from "@/router/names"; import { PERSONAL_PROFILE_ROUTE, SETTINGS_ROUTE } from "@/router/names";
import { useCourseSessionsStore } from "@/stores/courseSessions"; import { useCourseSessionsStore } from "@/stores/courseSessions";
import type { User } from "@/stores/user"; import type { User } from "@/stores/user";
import type { CourseSession } from "@/types"; import type { CourseSession } from "@/types";
@ -54,6 +54,9 @@ const mentorTabTitle = computed(() =>
const settingsRoute = { const settingsRoute = {
name: SETTINGS_ROUTE, name: SETTINGS_ROUTE,
}; };
const profileRoute = {
name: PERSONAL_PROFILE_ROUTE,
};
</script> </script>
<template> <template>
@ -71,6 +74,15 @@ const settingsRoute = {
</div> </div>
<div class="ml-6"> <div class="ml-6">
<h3>{{ user?.first_name }} {{ user?.last_name }}</h3> <h3>{{ user?.first_name }} {{ user?.last_name }}</h3>
<div class="mb-3 text-sm text-gray-800">{{ user.email }}</div>
<router-link
:to="profileRoute"
@click="emit('closemodal')"
class="underline"
>
{{ $t("a.Profil anzeigen") }}
</router-link>
</div> </div>
</div> </div>
</div> </div>
@ -147,7 +159,7 @@ const settingsRoute = {
</li> </li>
</ul> </ul>
</div> </div>
<div class="mt-6 border-b"> <div v-if="courseSession" class="mt-6 border-b">
<ul> <ul>
<li v-if="courseSession && hasMediaLibraryMenu" class="mb-6 flex"> <li v-if="courseSession && hasMediaLibraryMenu" class="mb-6 flex">
<router-link <router-link

View File

@ -2,7 +2,7 @@
import SubNavigation from "@/components/header/SubNavigation.vue"; import SubNavigation from "@/components/header/SubNavigation.vue";
import { useCurrentCourseSession } from "@/composables"; import { useCurrentCourseSession } from "@/composables";
import { useExpertCockpitPageData } from "@/pages/cockpit/cockpitPage/composables"; import { useExpertCockpitPageData } from "@/pages/cockpit/cockpitPage/composables";
import { ATTENDANCE_ROUTE, COCKPIT_ROUTE, DOCUMENTS_ROUTE } from "@/router/names"; import { COCKPIT_ROUTE, DOCUMENTS_ROUTE } from "@/router/names";
import { useTranslation } from "i18next-vue"; import { useTranslation } from "i18next-vue";
import log from "loglevel"; import log from "loglevel";
import { computed } from "vue"; import { computed } from "vue";
@ -18,9 +18,9 @@ const { loading } = useExpertCockpitPageData(props.courseSlug);
const defaultRoute = { const defaultRoute = {
name: COCKPIT_ROUTE, name: COCKPIT_ROUTE,
}; };
const attendanceRoute = { // const attendanceRoute = {
name: ATTENDANCE_ROUTE, // name: ATTENDANCE_ROUTE,
}; // };
const documentsRoute = { const documentsRoute = {
name: DOCUMENTS_ROUTE, name: DOCUMENTS_ROUTE,
}; };

View File

@ -20,6 +20,7 @@ import {
COMPETENCE_ROUTE, COMPETENCE_ROUTE,
COMPETENCES_ROUTE, COMPETENCES_ROUTE,
DOCUMENTS_ROUTE, DOCUMENTS_ROUTE,
PERSONAL_PROFILE_ROUTE,
SELF_EVALUATION_ROUTE, SELF_EVALUATION_ROUTE,
SETTINGS_ROUTE, SETTINGS_ROUTE,
} from "./names"; } from "./names";
@ -431,7 +432,7 @@ const router = createRouter({
{ {
path: "/profile", path: "/profile",
component: () => import("@/pages/personalProfile/PersonalProfilePage.vue"), component: () => import("@/pages/personalProfile/PersonalProfilePage.vue"),
name: "personalProfile", name: PERSONAL_PROFILE_ROUTE,
}, },
{ {
path: "/settings", path: "/settings",

View File

@ -6,3 +6,4 @@ export const SETTINGS_ROUTE = "settings";
export const COCKPIT_ROUTE = "cockpit-home"; export const COCKPIT_ROUTE = "cockpit-home";
export const ATTENDANCE_ROUTE = "attendance"; export const ATTENDANCE_ROUTE = "attendance";
export const DOCUMENTS_ROUTE = "documents"; export const DOCUMENTS_ROUTE = "documents";
export const PERSONAL_PROFILE_ROUTE = "personalProfile";