Added btn profile + add name user and last name into fields when connected
This commit is contained in:
@@ -35,7 +35,16 @@
|
||||
</v-btn>
|
||||
</v-list-item>
|
||||
<v-list-item v-if="currentUser">
|
||||
<v-btn @click="logout()" class="full-width-btn" flat>Déconnecter</v-btn>
|
||||
<router-link :to="{ name: 'yourprofile' }">
|
||||
<v-btn class="full-width-btn" flat>
|
||||
<v-icon left class="mr-4">mdi-account-details</v-icon>
|
||||
<p>Mon profil</p>
|
||||
</v-btn>
|
||||
</router-link>
|
||||
</v-list-item>
|
||||
|
||||
<v-list-item v-if="currentUser">
|
||||
<v-btn @click="handleLogout" class="full-width-btn" flat>Déconnecter</v-btn>
|
||||
</v-list-item>
|
||||
</v-list>
|
||||
</v-menu>
|
||||
@@ -80,9 +89,15 @@
|
||||
<v-list-item prepend-icon="mdi-handshake" title="Aidez-nous" value="friends"></v-list-item>
|
||||
</router-link>
|
||||
|
||||
<router-link :to="{ name: 'yourprofile' }">
|
||||
<v-list-item prepend-icon="mdi-account-details" title="Mon profil" value="friends"> </v-list-item>
|
||||
</router-link>
|
||||
|
||||
|
||||
<v-list-item v-if="currentUser" @click="openWalletDialog" prepend-icon="mdi-wallet" title="Bourse"
|
||||
value="wallet"></v-list-item>
|
||||
<v-list-item v-if="currentUser" @click="logout()" style="margin-top: 110%;" prepend-icon="mdi-logout"
|
||||
|
||||
<v-list-item v-if="currentUser" @click="handleLogout" style="margin-top: 110%;" prepend-icon="mdi-logout"
|
||||
title="Déconnecter" value="logout"></v-list-item>
|
||||
</v-list>
|
||||
</v-navigation-drawer>
|
||||
@@ -135,7 +150,6 @@ Hutopy est plus qu'une plateforme ; c'est une communauté où la transformation
|
||||
</v-btn>
|
||||
<v-btn @click="walletDialog = false" text="Fermer"></v-btn>
|
||||
</v-row>
|
||||
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</v-dialog>
|
||||
@@ -146,7 +160,10 @@ Hutopy est plus qu'une plateforme ; c'est une communauté où la transformation
|
||||
import MyUserModel from "@/models/myUserModel.js";
|
||||
import { useClient } from "@/plugins/api.js";
|
||||
import { onBeforeMount, ref } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
|
||||
const client = useClient();
|
||||
const router = useRouter();
|
||||
|
||||
const drawer = ref(false);
|
||||
const currentUserName = ref("INVITÉ");
|
||||
@@ -172,7 +189,17 @@ onBeforeMount(async () => {
|
||||
|
||||
function logout() {
|
||||
localStorage.removeItem('jwt');
|
||||
window.location.reload();
|
||||
currentUser = null;
|
||||
currentUserName.value = "INVITÉ";
|
||||
}
|
||||
|
||||
function handleLogout() {
|
||||
logout();
|
||||
Reroot();
|
||||
}
|
||||
|
||||
function Reroot() {
|
||||
router.push('/');
|
||||
}
|
||||
|
||||
function openWalletDialog() {
|
||||
|
||||
Reference in New Issue
Block a user