diff options
Diffstat (limited to 'apps/web/components')
| -rw-r--r-- | apps/web/components/dashboard/header/ProfileOptions.tsx | 2 | ||||
| -rw-r--r-- | apps/web/components/dashboard/sidebar/AllLists.tsx | 2 | ||||
| -rw-r--r-- | apps/web/components/dashboard/sidebar/ModileSidebar.tsx | 3 | ||||
| -rw-r--r-- | apps/web/components/dashboard/sidebar/Sidebar.tsx | 2 | ||||
| -rw-r--r-- | apps/web/components/settings/AISettings.tsx (renamed from apps/web/components/dashboard/settings/AISettings.tsx) | 0 | ||||
| -rw-r--r-- | apps/web/components/settings/AddApiKey.tsx (renamed from apps/web/components/dashboard/settings/AddApiKey.tsx) | 0 | ||||
| -rw-r--r-- | apps/web/components/settings/ApiKeySettings.tsx (renamed from apps/web/components/dashboard/settings/ApiKeySettings.tsx) | 0 | ||||
| -rw-r--r-- | apps/web/components/settings/ChangePassword.tsx (renamed from apps/web/components/dashboard/settings/ChangePassword.tsx) | 0 | ||||
| -rw-r--r-- | apps/web/components/settings/DeleteApiKey.tsx (renamed from apps/web/components/dashboard/settings/DeleteApiKey.tsx) | 0 | ||||
| -rw-r--r-- | apps/web/components/settings/ImportExport.tsx (renamed from apps/web/components/dashboard/settings/ImportExport.tsx) | 0 | ||||
| -rw-r--r-- | apps/web/components/settings/UserDetails.tsx (renamed from apps/web/components/dashboard/settings/UserDetails.tsx) | 0 | ||||
| -rw-r--r-- | apps/web/components/settings/sidebar/ModileSidebar.tsx | 19 | ||||
| -rw-r--r-- | apps/web/components/settings/sidebar/Sidebar.tsx | 34 | ||||
| -rw-r--r-- | apps/web/components/settings/sidebar/items.tsx | 34 | ||||
| -rw-r--r-- | apps/web/components/shared/sidebar/ModileSidebarItem.tsx (renamed from apps/web/components/dashboard/sidebar/ModileSidebarItem.tsx) | 0 | ||||
| -rw-r--r-- | apps/web/components/shared/sidebar/SidebarItem.tsx (renamed from apps/web/components/dashboard/sidebar/SidebarItem.tsx) | 0 |
16 files changed, 91 insertions, 5 deletions
diff --git a/apps/web/components/dashboard/header/ProfileOptions.tsx b/apps/web/components/dashboard/header/ProfileOptions.tsx index ea8c7d12..ee6cac01 100644 --- a/apps/web/components/dashboard/header/ProfileOptions.tsx +++ b/apps/web/components/dashboard/header/ProfileOptions.tsx @@ -62,7 +62,7 @@ export default function SidebarProfileOptions() { </div> <Separator className="my-2" /> <DropdownMenuItem asChild> - <Link href="/dashboard/settings"> + <Link href="/settings"> <Settings className="mr-2 size-4" /> User Settings </Link> diff --git a/apps/web/components/dashboard/sidebar/AllLists.tsx b/apps/web/components/dashboard/sidebar/AllLists.tsx index b6cadea9..c48ddb0f 100644 --- a/apps/web/components/dashboard/sidebar/AllLists.tsx +++ b/apps/web/components/dashboard/sidebar/AllLists.tsx @@ -3,6 +3,7 @@ import { useCallback } from "react"; import Link from "next/link"; import { usePathname } from "next/navigation"; +import SidebarItem from "@/components/shared/sidebar/SidebarItem"; import { Button } from "@/components/ui/button"; import { CollapsibleTriggerTriangle } from "@/components/ui/collapsible"; import { MoreHorizontal, Plus } from "lucide-react"; @@ -13,7 +14,6 @@ import { ZBookmarkListTreeNode } from "@hoarder/shared/utils/listUtils"; import { CollapsibleBookmarkLists } from "../lists/CollapsibleBookmarkLists"; import { EditListModal } from "../lists/EditListModal"; import { ListOptions } from "../lists/ListOptions"; -import SidebarItem from "./SidebarItem"; export default function AllLists({ initialData, diff --git a/apps/web/components/dashboard/sidebar/ModileSidebar.tsx b/apps/web/components/dashboard/sidebar/ModileSidebar.tsx index 7ccf6b8d..bfa91afa 100644 --- a/apps/web/components/dashboard/sidebar/ModileSidebar.tsx +++ b/apps/web/components/dashboard/sidebar/ModileSidebar.tsx @@ -1,8 +1,7 @@ +import MobileSidebarItem from "@/components/shared/sidebar/ModileSidebarItem"; import HoarderLogoIcon from "@/public/icons/logo-icon.svg"; import { ClipboardList, Search, Tag } from "lucide-react"; -import MobileSidebarItem from "./ModileSidebarItem"; - export default async function MobileSidebar() { return ( <aside className="w-full"> diff --git a/apps/web/components/dashboard/sidebar/Sidebar.tsx b/apps/web/components/dashboard/sidebar/Sidebar.tsx index 14d019ff..8021ad36 100644 --- a/apps/web/components/dashboard/sidebar/Sidebar.tsx +++ b/apps/web/components/dashboard/sidebar/Sidebar.tsx @@ -1,4 +1,5 @@ import { redirect } from "next/navigation"; +import SidebarItem from "@/components/shared/sidebar/SidebarItem"; import { Separator } from "@/components/ui/separator"; import { api } from "@/server/api/client"; import { getServerAuthSession } from "@/server/auth"; @@ -7,7 +8,6 @@ import { Archive, Home, Search, Tag } from "lucide-react"; import serverConfig from "@hoarder/shared/config"; import AllLists from "./AllLists"; -import SidebarItem from "./SidebarItem"; export default async function Sidebar() { const session = await getServerAuthSession(); diff --git a/apps/web/components/dashboard/settings/AISettings.tsx b/apps/web/components/settings/AISettings.tsx index 0a8db147..0a8db147 100644 --- a/apps/web/components/dashboard/settings/AISettings.tsx +++ b/apps/web/components/settings/AISettings.tsx diff --git a/apps/web/components/dashboard/settings/AddApiKey.tsx b/apps/web/components/settings/AddApiKey.tsx index 34fd2df7..34fd2df7 100644 --- a/apps/web/components/dashboard/settings/AddApiKey.tsx +++ b/apps/web/components/settings/AddApiKey.tsx diff --git a/apps/web/components/dashboard/settings/ApiKeySettings.tsx b/apps/web/components/settings/ApiKeySettings.tsx index 4d43be7a..4d43be7a 100644 --- a/apps/web/components/dashboard/settings/ApiKeySettings.tsx +++ b/apps/web/components/settings/ApiKeySettings.tsx diff --git a/apps/web/components/dashboard/settings/ChangePassword.tsx b/apps/web/components/settings/ChangePassword.tsx index aa27f223..aa27f223 100644 --- a/apps/web/components/dashboard/settings/ChangePassword.tsx +++ b/apps/web/components/settings/ChangePassword.tsx diff --git a/apps/web/components/dashboard/settings/DeleteApiKey.tsx b/apps/web/components/settings/DeleteApiKey.tsx index e2334c44..e2334c44 100644 --- a/apps/web/components/dashboard/settings/DeleteApiKey.tsx +++ b/apps/web/components/settings/DeleteApiKey.tsx diff --git a/apps/web/components/dashboard/settings/ImportExport.tsx b/apps/web/components/settings/ImportExport.tsx index 1145a42d..1145a42d 100644 --- a/apps/web/components/dashboard/settings/ImportExport.tsx +++ b/apps/web/components/settings/ImportExport.tsx diff --git a/apps/web/components/dashboard/settings/UserDetails.tsx b/apps/web/components/settings/UserDetails.tsx index 471a6e09..471a6e09 100644 --- a/apps/web/components/dashboard/settings/UserDetails.tsx +++ b/apps/web/components/settings/UserDetails.tsx diff --git a/apps/web/components/settings/sidebar/ModileSidebar.tsx b/apps/web/components/settings/sidebar/ModileSidebar.tsx new file mode 100644 index 00000000..2016c931 --- /dev/null +++ b/apps/web/components/settings/sidebar/ModileSidebar.tsx @@ -0,0 +1,19 @@ +import MobileSidebarItem from "@/components/shared/sidebar/ModileSidebarItem"; + +import { settingsSidebarItems } from "./items"; + +export default async function MobileSidebar() { + return ( + <aside className="w-full"> + <ul className="flex justify-between space-x-2 border-b-black px-5 py-2 pt-5"> + {settingsSidebarItems.map((item) => ( + <MobileSidebarItem + key={item.name} + logo={item.icon} + path={item.path} + /> + ))} + </ul> + </aside> + ); +} diff --git a/apps/web/components/settings/sidebar/Sidebar.tsx b/apps/web/components/settings/sidebar/Sidebar.tsx new file mode 100644 index 00000000..247e0916 --- /dev/null +++ b/apps/web/components/settings/sidebar/Sidebar.tsx @@ -0,0 +1,34 @@ +import { redirect } from "next/navigation"; +import SidebarItem from "@/components/shared/sidebar/SidebarItem"; +import { getServerAuthSession } from "@/server/auth"; + +import serverConfig from "@hoarder/shared/config"; + +import { settingsSidebarItems } from "./items"; + +export default async function Sidebar() { + const session = await getServerAuthSession(); + if (!session) { + redirect("/"); + } + + return ( + <aside className="flex h-[calc(100vh-64px)] w-60 flex-col gap-5 border-r p-4 "> + <div> + <ul className="space-y-2 text-sm font-medium"> + {settingsSidebarItems.map((item) => ( + <SidebarItem + key={item.name} + logo={item.icon} + name={item.name} + path={item.path} + /> + ))} + </ul> + </div> + <div className="mt-auto flex items-center border-t pt-2 text-sm text-gray-400"> + Hoarder v{serverConfig.serverVersion} + </div> + </aside> + ); +} diff --git a/apps/web/components/settings/sidebar/items.tsx b/apps/web/components/settings/sidebar/items.tsx new file mode 100644 index 00000000..999825db --- /dev/null +++ b/apps/web/components/settings/sidebar/items.tsx @@ -0,0 +1,34 @@ +import React from "react"; +import { ArrowLeft, Download, KeyRound, Sparkles, User } from "lucide-react"; + +export const settingsSidebarItems: { + name: string; + icon: JSX.Element; + path: string; +}[] = [ + { + name: "Back To App", + icon: <ArrowLeft size={18} />, + path: "/dashboard/bookmarks", + }, + { + name: "User Info", + icon: <User size={18} />, + path: "/settings/info", + }, + { + name: "AI Settings", + icon: <Sparkles size={18} />, + path: "/settings/ai", + }, + { + name: "Import / Export", + icon: <Download size={18} />, + path: "/settings/import", + }, + { + name: "API Keys", + icon: <KeyRound size={18} />, + path: "/settings/api-keys", + }, +]; diff --git a/apps/web/components/dashboard/sidebar/ModileSidebarItem.tsx b/apps/web/components/shared/sidebar/ModileSidebarItem.tsx index 4d3436ea..4d3436ea 100644 --- a/apps/web/components/dashboard/sidebar/ModileSidebarItem.tsx +++ b/apps/web/components/shared/sidebar/ModileSidebarItem.tsx diff --git a/apps/web/components/dashboard/sidebar/SidebarItem.tsx b/apps/web/components/shared/sidebar/SidebarItem.tsx index 83ce776e..83ce776e 100644 --- a/apps/web/components/dashboard/sidebar/SidebarItem.tsx +++ b/apps/web/components/shared/sidebar/SidebarItem.tsx |
