2024-09-23 20:56:07 +02:00
|
|
|
<template>
|
|
|
|
<div class="navbar">
|
|
|
|
<div class="navbar-start">
|
|
|
|
<a class="btn btn-ghost text-xl" href="/">Chrys4lide</a>
|
|
|
|
</div>
|
|
|
|
<nav class="navbar-center">
|
|
|
|
<NuxtLink to="/" class="btn btn-ghost">Accueil</NuxtLink>
|
|
|
|
<NuxtLink to="/CPS" class="btn btn-ghost">Carte CPS</NuxtLink>
|
|
|
|
</nav>
|
|
|
|
<div class="navbar-end">
|
2024-09-24 01:05:02 +02:00
|
|
|
<template v-if="!current_user">
|
|
|
|
<button class="btn btn-ghost" type="button" onclick="login_modal.showModal()">
|
|
|
|
Connexion
|
|
|
|
</button>
|
|
|
|
</template>
|
|
|
|
<template v-else>
|
|
|
|
<details class="dropdown dropdown-end">
|
|
|
|
<summary class="block"><Avatar :user="current_user" class="w-12" role="button" /></summary>
|
|
|
|
<ul class="menu dropdown-content bg-base-100 rounded-box z-[1] w-52 p-2 shadow">
|
|
|
|
<li><a @click="logout">Déconnexion</a></li>
|
|
|
|
</ul>
|
|
|
|
</details>
|
|
|
|
</template>
|
2024-09-23 20:56:07 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
2024-09-24 01:05:02 +02:00
|
|
|
<LoginModal />
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
const current_user = useCurrentUser();
|
|
|
|
|
|
|
|
const logout = () => {
|
|
|
|
current_user.value = null;
|
|
|
|
};
|
|
|
|
</script>
|