From d6e17e23528f036bec30e89eb28b43325832c784 Mon Sep 17 00:00:00 2001 From: thomasabishop Date: Fri, 18 Jul 2025 15:30:31 +0100 Subject: [PATCH] refactor: partition AppSidebar subcomponents --- src/components/EntriesListSidebar.tsx | 35 +++++ src/components/TagListSidebar.tsx | 35 +++++ src/containers/AppSidebar.tsx | 188 +++++++++----------------- 3 files changed, 134 insertions(+), 124 deletions(-) create mode 100644 src/components/EntriesListSidebar.tsx create mode 100644 src/components/TagListSidebar.tsx diff --git a/src/components/EntriesListSidebar.tsx b/src/components/EntriesListSidebar.tsx new file mode 100644 index 0000000..6b03424 --- /dev/null +++ b/src/components/EntriesListSidebar.tsx @@ -0,0 +1,35 @@ +import { FileText, ChevronRight } from "lucide-react" + +import { SidebarMenuButton, SidebarMenuItem, SidebarMenuSub } from "@/components/ui/sidebar" +import { Collapsible, CollapsibleTrigger } from "@radix-ui/react-collapsible" +import { CollapsibleContent } from "../components/ui/collapsible" + +import { mockEntries } from "@/mock-data/mock-entries" +export default function EntriesListSidebar() { + return ( + + + + + + + Entries + + + + + + + {mockEntries.map((item) => ( + + + {item.title} + + + ))} + + + + + ) +} diff --git a/src/components/TagListSidebar.tsx b/src/components/TagListSidebar.tsx new file mode 100644 index 0000000..b5f4ab6 --- /dev/null +++ b/src/components/TagListSidebar.tsx @@ -0,0 +1,35 @@ +import { Tags, ChevronRight } from "lucide-react" + +import { SidebarMenuButton, SidebarMenuItem, SidebarMenuSub } from "@/components/ui/sidebar" +import { Collapsible, CollapsibleTrigger } from "@radix-ui/react-collapsible" +import { CollapsibleContent } from "../components/ui/collapsible" +import { mockTags } from "@/mock-data/mock-tags" + +export default function TagListSidebar() { + return ( + + + + + + + Tags + + + + + + + {mockTags.map((item) => ( + + + {item.title} + + + ))} + + + + + ) +} diff --git a/src/containers/AppSidebar.tsx b/src/containers/AppSidebar.tsx index fa6e2d1..6e2800e 100644 --- a/src/containers/AppSidebar.tsx +++ b/src/containers/AppSidebar.tsx @@ -1,63 +1,47 @@ -import { - FileText, - Waypoints, - SquareLibrary, - Settings, - Tags, - Info, - ChevronRight, -} from "lucide-react" +import { FileText, Waypoints, SquareLibrary, Settings, ChevronRight } from "lucide-react" import { - Sidebar, - SidebarContent, - SidebarGroup, - SidebarGroupContent, - SidebarMenu, - SidebarMenuButton, - SidebarMenuItem, - SidebarHeader, - SidebarFooter, - SidebarMenuSub, + Sidebar, + SidebarContent, + SidebarGroup, + SidebarGroupContent, + SidebarMenu, + SidebarMenuButton, + SidebarMenuItem, + SidebarHeader, + SidebarFooter, } from "@/components/ui/sidebar" -import { Collapsible, CollapsibleTrigger } from "@radix-ui/react-collapsible" -import { CollapsibleContent } from "../components/ui/collapsible" -import { mockEntries } from "@/mock-data/mock-entries" -import { mockTags } from "@/mock-data/mock-tags" +import TagListSidebar from "@/components/TagListSidebar" +import EntriesListSidebar from "@/components/EntriesListSidebar" const footerMenu = [ - { - title: "About", - url: "#", - icon: Info, - }, - - { - title: "Settings", - url: "#", - icon: Settings, - }, + { + title: "Settings", + url: "#", + icon: Settings, + }, ] export function AppSidebar() { - return ( - - - - - - - - Eólas - - - - - - - - - + return ( + + + + + + + + Eólas + + + + + + + + + + {/* @@ -66,76 +50,32 @@ export function AppSidebar() { - - - - - - - Entries - - - - - - - {mockEntries.map((item) => ( - - - {item.title} - - - ))} - - - - - - - - - - - Tags - - - - - - - {mockTags.map((item) => ( - - - {item.title} - - - ))} - - - - - - - - - - - - - {footerMenu.map((item) => ( - - - - - {item.title} - - - - ))} - - - - - - ) + + */} + + + + + + + + + + + {footerMenu.map((item) => ( + + + + + {item.title} + + + + ))} + + + + + + ) }