refactor: ♻️ More work on rewriting notes

This commit is contained in:
Jesse Wierzbinski 2024-11-30 16:21:16 +01:00
parent d29f181000
commit 8cc4ff1348
No known key found for this signature in database
20 changed files with 514 additions and 63 deletions

View file

@ -1,12 +1,14 @@
<script setup lang="ts">
import {
BadgeCheck,
BedSingle,
Bell,
ChevronRight,
ChevronsUpDown,
Globe,
House,
LogOut,
MoreHorizontal,
MapIcon,
Settings2,
} from "lucide-vue-next";
import { Avatar, AvatarFallback, AvatarImage } from "~/components/ui/avatar";
@ -55,30 +57,6 @@ import ThemeSwitcher from "./theme-switcher.vue";
const data = {
navMain: [
{
title: "Timelines",
url: "#",
icon: House,
isActive: true,
items: [
{
title: "Home",
url: "/home",
},
{
title: "Public",
url: "/public",
},
{
title: "Local",
url: "/local",
},
{
title: "Global",
url: "/global",
},
],
},
{
title: "Settings",
url: "#",
@ -104,6 +82,26 @@ const data = {
},
],
other: [
{
name: "Home",
url: "/home",
icon: House,
},
{
name: "Public",
url: "/public",
icon: MapIcon,
},
{
name: "Local",
url: "/local",
icon: BedSingle,
},
{
name: "Global",
url: "/global",
icon: Globe,
},
{
name: "Notifications",
url: "/notifications",
@ -140,8 +138,21 @@ const instance = useInstance();
</SidebarMenu>
</SidebarHeader>
<SidebarContent>
<SidebarGroup>
<SidebarGroup class="group-data-[collapsible=icon]:hidden">
<SidebarGroupLabel>Navigation</SidebarGroupLabel>
<SidebarMenu>
<SidebarMenuItem v-for="item in data.other" :key="item.name">
<SidebarMenuButton as-child>
<NuxtLink :href="item.url">
<component :is="item.icon" />
<span>{{ item.name }}</span>
</NuxtLink>
</SidebarMenuButton>
</SidebarMenuItem>
</SidebarMenu>
</SidebarGroup>
<SidebarGroup class="mt-auto">
<SidebarGroupLabel>More</SidebarGroupLabel>
<SidebarMenu>
<Collapsible v-for="item in data.navMain" :key="item.title" as-child
:default-open="item.isActive" class="group/collapsible">
@ -169,19 +180,6 @@ const instance = useInstance();
</Collapsible>
</SidebarMenu>
</SidebarGroup>
<SidebarGroup class="group-data-[collapsible=icon]:hidden">
<SidebarGroupLabel>Other</SidebarGroupLabel>
<SidebarMenu>
<SidebarMenuItem v-for="item in data.other" :key="item.name">
<SidebarMenuButton as-child>
<NuxtLink :href="item.url">
<component :is="item.icon" />
<span>{{ item.name }}</span>
</NuxtLink>
</SidebarMenuButton>
</SidebarMenuItem>
</SidebarMenu>
</SidebarGroup>
</SidebarContent>
<SidebarFooter>
<SidebarMenu>
@ -264,7 +262,7 @@ const instance = useInstance();
</Breadcrumb>
</div>
</header>
<div class="flex flex-1 flex-col gap-4 md:p-1 overflow-auto">
<div class="flex flex-1 flex-col gap-4 md:p-1 overflow-auto *:z-10">
<slot />
</div>
</SidebarInset>