feat: manually close popovers
This commit is contained in:
parent
c103d29f31
commit
cc61816c92
|
|
@ -5,6 +5,7 @@
|
||||||
:user="userStore"
|
:user="userStore"
|
||||||
@logout="logout"
|
@logout="logout"
|
||||||
@select-course-session="selectCourseSession"
|
@select-course-session="selectCourseSession"
|
||||||
|
@close="emit('close')"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
@ -14,6 +15,8 @@ import { useCourseSessionsStore } from "@/stores/courseSessions";
|
||||||
import { useUserStore } from "@/stores/user";
|
import { useUserStore } from "@/stores/user";
|
||||||
import type { CourseSession } from "@/types";
|
import type { CourseSession } from "@/types";
|
||||||
|
|
||||||
|
const emit = defineEmits(["close"]);
|
||||||
|
|
||||||
const logout = () => {
|
const logout = () => {
|
||||||
userStore.handleLogout();
|
userStore.handleLogout();
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@
|
||||||
import CourseSessionsMenu from "@/components/header/CourseSessionsMenu.vue";
|
import CourseSessionsMenu from "@/components/header/CourseSessionsMenu.vue";
|
||||||
import type { User } from "@/stores/user";
|
import type { User } from "@/stores/user";
|
||||||
import type { CourseSession } from "@/types";
|
import type { CourseSession } from "@/types";
|
||||||
import { PopoverButton } from "@headlessui/vue";
|
|
||||||
import { useRouter } from "vue-router";
|
import { useRouter } from "vue-router";
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
|
|
@ -11,12 +10,13 @@ const props = defineProps<{
|
||||||
selectedCourseSession?: string;
|
selectedCourseSession?: string;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
const emit = defineEmits(["selectCourseSession", "logout"]);
|
const emit = defineEmits(["selectCourseSession", "logout", "close"]);
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
async function navigate(routeName: string) {
|
async function navigate(routeName: string) {
|
||||||
await router.push({ name: routeName });
|
await router.push({ name: routeName });
|
||||||
|
emit("close");
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
@ -34,9 +34,9 @@ async function navigate(routeName: string) {
|
||||||
<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>
|
<div class="mb-3 text-sm text-gray-800">{{ user.email }}</div>
|
||||||
<PopoverButton @click="navigate('personalProfile')">
|
<button class="underline" @click="navigate('personalProfile')">
|
||||||
{{ $t("a.Profil anzeigen") }}
|
{{ $t("a.Profil anzeigen") }}
|
||||||
</PopoverButton>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -133,7 +133,7 @@ const hasMentorManagementMenu = computed(() => {
|
||||||
:show="state.showMobileProfileMenu"
|
:show="state.showMobileProfileMenu"
|
||||||
@closemodal="state.showMobileProfileMenu = false"
|
@closemodal="state.showMobileProfileMenu = false"
|
||||||
>
|
>
|
||||||
<AccountMenu />
|
<AccountMenu @close="state.showMobileProfileMenu = false" />
|
||||||
</ItFullScreenModal>
|
</ItFullScreenModal>
|
||||||
</Teleport>
|
</Teleport>
|
||||||
<Transition name="nav">
|
<Transition name="nav">
|
||||||
|
|
@ -325,10 +325,11 @@ const hasMentorManagementMenu = computed(() => {
|
||||||
</PopoverButton>
|
</PopoverButton>
|
||||||
|
|
||||||
<PopoverPanel
|
<PopoverPanel
|
||||||
|
v-slot="{ close }"
|
||||||
class="absolute -right-2 top-8 z-50 w-[500px] bg-white shadow-lg"
|
class="absolute -right-2 top-8 z-50 w-[500px] bg-white shadow-lg"
|
||||||
>
|
>
|
||||||
<div class="p-4">
|
<div class="p-4">
|
||||||
<AccountMenu />
|
<AccountMenu @close="close" />
|
||||||
</div>
|
</div>
|
||||||
</PopoverPanel>
|
</PopoverPanel>
|
||||||
</Popover>
|
</Popover>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue