Skip to content

Commit

Permalink
Merge pull request #271 from bcc-code/feature/back-button
Browse files Browse the repository at this point in the history
add back button
  • Loading branch information
kkuepper authored Jan 25, 2024
2 parents a54c318 + 0bbbf2a commit 7e6e43c
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 = computed(() => 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 7e6e43c

Please sign in to comment.