Adds link to creator page in the user menu

This commit is contained in:
Jonathan Bourdon
2024-07-20 01:07:52 -04:00
parent 8afa037fbe
commit c358eb98d8
3 changed files with 17 additions and 32 deletions

View File

@@ -53,12 +53,12 @@
<div class="text-center">
<v-menu open-on-hover>
<template v-slot:activator="{ props }">
<v-btn variant="plain" v-bind="props" class=" d-flex align-center text-capital-none">
<v-btn variant="plain" v-bind="props" class="d-flex align-center text-capital-none">
<span class="normal-case max-w-xs hidden md:block">
{{ currentUserName }}
{{ currentUser.userName }}
</span>
<img
:src="currentUser.storedDataUrls.profilePictureUrl"
<img
:src="currentUser.storedDataUrls.profilePictureUrl"
alt="Profile Image"
@error="handleProfilePictureError"
class="ml-2 rounded-full" style="width: 32px; height: 32px;">
@@ -66,6 +66,7 @@
</template>
<v-list min-width="200px" class=" align-center mt-3 left-3">
<div v-if="currentUser.userName === 'Anonyme'">
<v-list-item class="nav-button">
<v-list-item-title>
@@ -75,13 +76,15 @@
</div>
<div v-if="currentUser.userName !== 'Anonyme'">
<v-list-item class="nav-button">
<router-link :to="`/@${currentUserName}`">
<v-btn class="w-100 " variant="plain"> {{ currentUserName }}</v-btn>
<v-list-item v-if="currentUser.creatorAlias !== null" class="nav-button">
<router-link :to="`/@${currentUser.creatorAlias}`">
<v-btn class="w-100 " variant="plain">@{{ currentUser.creatorAlias }}</v-btn>
</router-link>
</v-list-item>
<v-list-item class="nav-button">
<v-list-item-title >
<v-list-item-title>
<v-btn to="/profile" class="w-100 " variant="plain">Mon profil</v-btn>
</v-list-item-title>
</v-list-item>
@@ -89,7 +92,7 @@
<v-list-item-title>
<v-btn to="/wallet" class="w-100 " variant="plain"> Portefeuille</v-btn>
</v-list-item-title>
</v-list-item>
</v-list-item>
<v-list-item class="nav-button">
<v-list-item-title>
<v-btn @click="logout" to="/wallet" class="w-100 " variant="plain"> Déconnexion</v-btn>
@@ -113,7 +116,6 @@ import {useUserStore} from "@/stores/user.js";
import MyUserModel from "@/models/myUserModel.js";
const router = useRouter();
const currentUserName = ref("Anonyme");
const searchQuery = ref("");
const showSearch = ref(false);
let currentUser = reactive(MyUserModel.getDefaultUser());
@@ -161,10 +163,8 @@ const logout = () => {
window.location.reload();
};
onBeforeMount( () => {
onBeforeMount(() => {
currentUser = userStore.getCurrentUser();
currentUserName.value = currentUser.userName;
document.addEventListener('click', handleClickOutside);
});