Profile updated
This commit is contained in:
@@ -51,37 +51,55 @@
|
||||
<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">
|
||||
|
||||
<span class="normal-case max-w-xs hidden md:block">
|
||||
{{ currentUserName }}
|
||||
</span>
|
||||
<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 }}
|
||||
</span>
|
||||
<img src="/images/usersmedia/anonyme/profilepictures/profileAnonymeSquare.png" alt="Profile Image"
|
||||
class="ml-2 rounded-full" style="width: 32px; height: 32px;">
|
||||
</v-btn>
|
||||
</template>
|
||||
|
||||
<v-list class="mt-2">
|
||||
<v-list-item>
|
||||
<v-list-item-title>
|
||||
<router-link to="/profile">
|
||||
Mon profil
|
||||
</router-link>
|
||||
</v-list-item-title>
|
||||
</v-list-item>
|
||||
<v-list-item>
|
||||
<v-list-item-title>
|
||||
<router-link to="/wallet">
|
||||
Mon wallet
|
||||
</router-link>
|
||||
</v-list-item-title>
|
||||
</v-list-item>
|
||||
<v-list-item @click="navigateToMessages">
|
||||
<v-list-item-title>Messages</v-list-item-title>
|
||||
</v-list-item>
|
||||
<v-list-item @click="logout">
|
||||
<v-list-item-title>Déconnexion</v-list-item-title>
|
||||
</v-list-item>
|
||||
<v-list min-width="200px" class=" align-center mt-3 left-3">
|
||||
<div v-if="!currentUser">
|
||||
<v-list-item class="nav-button">
|
||||
<v-list-item-title>
|
||||
<router-link to="/login">
|
||||
Connexion
|
||||
</router-link>
|
||||
</v-list-item-title>
|
||||
</v-list-item>
|
||||
</div>
|
||||
|
||||
<div v-if="currentUser">
|
||||
<v-list-item class="nav-button">
|
||||
<v-list-item-title>
|
||||
<router-link :to="`/${currentUserName}`">
|
||||
{{ currentUserName }}
|
||||
</router-link>
|
||||
</v-list-item-title>
|
||||
</v-list-item>
|
||||
<v-list-item class="nav-button">
|
||||
<v-list-item-title>
|
||||
<router-link to="/profile">
|
||||
Mon profil
|
||||
</router-link>
|
||||
</v-list-item-title>
|
||||
</v-list-item>
|
||||
<v-list-item class="nav-button">
|
||||
<v-list-item-title>
|
||||
<router-link to="/wallet">
|
||||
Mon wallet
|
||||
</router-link>
|
||||
</v-list-item-title>
|
||||
</v-list-item>
|
||||
<v-list-item class="nav-button" @click="navigateToMessages">
|
||||
<v-list-item-title>Messages</v-list-item-title>
|
||||
</v-list-item>
|
||||
<v-list-item class="nav-button" @click="logout">
|
||||
<v-list-item-title>Déconnexion</v-list-item-title>
|
||||
</v-list-item>
|
||||
</div>
|
||||
</v-list>
|
||||
</v-menu>
|
||||
</div>
|
||||
@@ -93,13 +111,13 @@
|
||||
|
||||
<script setup>
|
||||
import MyUserModel from "@/models/myUserModel.js";
|
||||
import { useClient } from "@/plugins/api.js";
|
||||
import { ref, onMounted, onBeforeUnmount } from "vue";
|
||||
import { eventBus } from '@/eventBus.js';
|
||||
import { useRouter } from 'vue-router';
|
||||
import {useClient} from "@/plugins/api.js";
|
||||
import {ref, onMounted, onBeforeUnmount} from "vue";
|
||||
import {eventBus} from '@/eventBus.js';
|
||||
import {useRouter} from 'vue-router';
|
||||
|
||||
const router = useRouter();
|
||||
const currentUserName = ref("INVITÉ");
|
||||
const currentUserName = ref("Anonyme");
|
||||
const searchQuery = ref("");
|
||||
const showSearch = ref(false);
|
||||
let currentUser = null;
|
||||
@@ -118,7 +136,7 @@ const onSearch = () => {
|
||||
if (words.length === 1) {
|
||||
router.push(`/@${words[0]}`);
|
||||
} else {
|
||||
router.push({ name: "browse", query: { q: query } });
|
||||
router.push({name: "browse", query: {q: query}});
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -151,7 +169,7 @@ onMounted(async () => {
|
||||
const myUser = await client.get("/api/GetMyUser");
|
||||
const currentUserModel = MyUserModel.createFromApiResult(myUser.data);
|
||||
currentUser = currentUserModel;
|
||||
currentUserName.value = currentUserModel.firstName + " " + currentUserModel.lastName;
|
||||
currentUserName.value = currentUserModel.userName;
|
||||
} catch (error) {
|
||||
console.log("User not logged");
|
||||
}
|
||||
@@ -168,4 +186,8 @@ onBeforeUnmount(() => {
|
||||
.search-container {
|
||||
position: relative;
|
||||
}
|
||||
.nav-button:hover {
|
||||
@apply bg-[#903175] text-gray-200;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user