From 5902664658a36e4afc81327eea9f8eef05561bcb Mon Sep 17 00:00:00 2001 From: Mohamed Bassem Date: Mon, 30 Dec 2024 12:15:35 +0000 Subject: refactor: Refactor sidebar into a shared component --- .../components/dashboard/sidebar/ModileSidebar.tsx | 23 ------ apps/web/components/dashboard/sidebar/Sidebar.tsx | 81 ---------------------- 2 files changed, 104 deletions(-) delete mode 100644 apps/web/components/dashboard/sidebar/ModileSidebar.tsx delete mode 100644 apps/web/components/dashboard/sidebar/Sidebar.tsx (limited to 'apps/web/components/dashboard/sidebar') diff --git a/apps/web/components/dashboard/sidebar/ModileSidebar.tsx b/apps/web/components/dashboard/sidebar/ModileSidebar.tsx deleted file mode 100644 index 777877bf..00000000 --- a/apps/web/components/dashboard/sidebar/ModileSidebar.tsx +++ /dev/null @@ -1,23 +0,0 @@ -import MobileSidebarItem from "@/components/shared/sidebar/ModileSidebarItem"; -import HoarderLogoIcon from "@/public/icons/logo-icon.svg"; -import { ClipboardList, Highlighter, Search, Tag } from "lucide-react"; - -export default async function MobileSidebar() { - return ( - - ); -} diff --git a/apps/web/components/dashboard/sidebar/Sidebar.tsx b/apps/web/components/dashboard/sidebar/Sidebar.tsx deleted file mode 100644 index 0f805a09..00000000 --- a/apps/web/components/dashboard/sidebar/Sidebar.tsx +++ /dev/null @@ -1,81 +0,0 @@ -import { redirect } from "next/navigation"; -import SidebarItem from "@/components/shared/sidebar/SidebarItem"; -import { Separator } from "@/components/ui/separator"; -import { useTranslation } from "@/lib/i18n/server"; -import { api } from "@/server/api/client"; -import { getServerAuthSession } from "@/server/auth"; -import { Archive, Highlighter, Home, Search, Tag } from "lucide-react"; - -import serverConfig from "@hoarder/shared/config"; - -import AllLists from "./AllLists"; - -export default async function Sidebar() { - const { t } = await useTranslation(); - const session = await getServerAuthSession(); - if (!session) { - redirect("/"); - } - - const lists = await api.lists.list(); - - const searchItem = serverConfig.meilisearch - ? [ - { - name: t("common.search"), - icon: , - path: "/dashboard/search", - }, - ] - : []; - - const menu: { - name: string; - icon: JSX.Element; - path: string; - }[] = [ - { - name: t("common.home"), - icon: , - path: "/dashboard/bookmarks", - }, - ...searchItem, - { - name: t("common.tags"), - icon: , - path: "/dashboard/tags", - }, - { - name: t("common.highlights"), - icon: , - path: "/dashboard/highlights", - }, - { - name: t("common.archive"), - icon: , - path: "/dashboard/archive", - }, - ]; - - return ( - - ); -} -- cgit v1.2.3-70-g09d2