Skip to content

Commit

Permalink
show back button
Browse files Browse the repository at this point in the history
  • Loading branch information
kkuepper committed Jan 23, 2024
1 parent f2bc2b3 commit 20818e4
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions components/AppToolbar.vue
Original file line number Diff line number Diff line change
@@ -1,12 +1,28 @@
<script setup type="ts">
const route = useRoute();
const showBackButton = () => route.name !== "index" && route.name !== "search" && route.name !== "browse";
</script>
<template>
<header
class="sticky top-0 z-20 flex justify-between border-b border-label-separator bg-white-2 px-6 py-4 backdrop-blur-md dark:bg-black-2"
class="sticky top-0 z-20 flex justify-between border-b border-label-separator bg-white-2 backdrop-blur-md dark:bg-black-2"
>
<strong v-if="toolbarTitleStore().toolbarTitle" class="text-label-1">
{{ toolbarTitleStore().toolbarTitle }}
</strong>
<div class="flex flex-row mx-5">
<div
v-if="showBackButton()"
class="p-4 cursor-pointer"
@click="$router.back()"
>
<NuxtIcon name="icon.chevron.left-1" class="text-2xl" />
</div>
<strong
v-if="toolbarTitleStore().toolbarTitle"
class="text-label-1 mx-1 my-4"
>
{{ toolbarTitleStore().toolbarTitle }}
</strong>
</div>

<div class="flex flex-row">
<div class="flex flex-row mx-6 my-4">
<ProfileMenu />
</div>
</header>
Expand Down

0 comments on commit 20818e4

Please sign in to comment.