Skip to content

Commit

Permalink
move admin link to navbar
Browse files Browse the repository at this point in the history
  • Loading branch information
Klrfl committed Aug 28, 2024
1 parent 22da933 commit c53f702
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
13 changes: 4 additions & 9 deletions components/TheFooter.vue
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
<template>
<footer>
<footer class="dark:bg-surface-800">
<p>Klrfl, 2023.</p>
<a href="https://github.com/pplg-smkmetland/metschoo-library">This website on Github</a>
<NuxtLink to="/admin"> masuk ke admin </NuxtLink>
<a class="block" href="https://github.com/pplg-smkmetland/metschoo-library">
This website on Github
</a>
</footer>
</template>

<style scoped>
footer {
background: #222;
color: #ddd;
padding: 2rem;
}
footer a {
display: block;
}
</style>
6 changes: 5 additions & 1 deletion components/TheNavbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ function closeNav() {
}
const user = useSupabaseUser()
const isAdmin = computed(() => user.value.app_metadata.role === "super-admin")
</script>

<template>
Expand Down Expand Up @@ -43,9 +44,12 @@ const user = useSupabaseUser()
<li v-if="!user">
<NuxtLink to="/login" class="nav-link nav-link--cta"> Masuk </NuxtLink>
</li>
<li v-else>
<li v-if="!isAdmin">
<NuxtLink to="/profil" class="nav-link nav-link--cta"> Profil </NuxtLink>
</li>
<li v-else>
<NuxtLink to="/admin" class="nav-link nav-link--cta"> Admin </NuxtLink>
</li>
</ul>

<button ref="openNavBtn" class="nav-btn open" @click="openNav">
Expand Down

0 comments on commit c53f702

Please sign in to comment.