Skip to content

Commit

Permalink
feat: set active directory in navbar
Browse files Browse the repository at this point in the history
  • Loading branch information
mattiasghodsian committed Sep 1, 2024
1 parent 4242394 commit df4c299
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src-frontend/components/NavBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ defineProps({
});
const isCurrentPage = (slug: string): boolean => {
return (route.path == slug);
return (route.path == slug) || (route.params.directory == slug);
};
</script>

Expand All @@ -33,7 +33,11 @@ const isCurrentPage = (slug: string): boolean => {
</li>
</ul>
<div class="pt-2 space-y-2">
<RouterLink v-for="(directory, index) in apiStore.directories" :to="{ name: 'manager', params: { directory: directory} }" :key="index" class="flex items-center p-2 text-base transition duration-75 rounded-lg text-gray-200 hover:bg-gray-700">
<RouterLink v-for="(directory, index) in apiStore.directories"
:to="{ name: 'manager', params: { directory: directory} }"
:key="index"
class="flex items-center p-2 text-base transition duration-75 rounded-lg text-gray-200 hover:bg-gray-700"
:class="{ 'font-bold bg-gray-700 text-gray-200': isCurrentPage(directory) }">
<IconFolder class="w-5 h-5 fill-gray-400 group-hover:fill-white"/>
<span class="ml-3" sidebar-toggle-item="">{{ directory }}</span>
</RouterLink>
Expand Down

0 comments on commit df4c299

Please sign in to comment.