From ad1cd151dca2147a74106e3687fa24dccc4392ce Mon Sep 17 00:00:00 2001 From: Klesti Selimaj Date: Tue, 18 Aug 2026 23:12:02 +0200 Subject: [PATCH] Added sidebar --- package-lock.json | 11 ++++++++ package.json | 1 + src/App.tsx | 21 +++++++++++++-- src/components/ui/resizable.tsx | 48 +++++++++++++++++++++++++++++++++ src/components/view/Sidebar.tsx | 9 +++++++ 5 files changed, 88 insertions(+), 2 deletions(-) create mode 100644 src/components/ui/resizable.tsx create mode 100644 src/components/view/Sidebar.tsx diff --git a/package-lock.json b/package-lock.json index 00d3260..2586ccc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23,6 +23,7 @@ "lucide-react": "^1.31.0", "react": "^19.1.0", "react-dom": "^19.1.0", + "react-resizable-panels": "^4.12.3", "shadcn": "^4.18.0", "tailwind-merge": "^3.6.0", "tailwindcss": "^4.3.3", @@ -5348,6 +5349,16 @@ "node": ">=0.10.0" } }, + "node_modules/react-resizable-panels": { + "version": "4.12.3", + "resolved": "https://registry.npmjs.org/react-resizable-panels/-/react-resizable-panels-4.12.3.tgz", + "integrity": "sha512-GHMJWnDXui/3RX4bT+cgBP+N3N2nkwcoZATr/2xLFpqQQe7TlBrE0cGM0dUa9ceT7A90tUrSRsiqgRG+g0/2AA==", + "license": "MIT", + "peerDependencies": { + "react": "^18.0.0 || ^19.0.0", + "react-dom": "^18.0.0 || ^19.0.0" + } + }, "node_modules/recast": { "version": "0.23.21", "resolved": "https://registry.npmjs.org/recast/-/recast-0.23.21.tgz", diff --git a/package.json b/package.json index 4d36280..df923d7 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,7 @@ "lucide-react": "^1.31.0", "react": "^19.1.0", "react-dom": "^19.1.0", + "react-resizable-panels": "^4.12.3", "shadcn": "^4.18.0", "tailwind-merge": "^3.6.0", "tailwindcss": "^4.3.3", diff --git a/src/App.tsx b/src/App.tsx index 847cc19..da1f891 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -2,6 +2,12 @@ import { useReducer, useRef } from "react"; import Enclave from "@/app/app"; import ServerList from "./components/view/ServerList"; import { NewProfilePage } from "./components/view/NewProfileView"; +import { + ResizableHandle, + ResizablePanel, + ResizablePanelGroup, +} from "./components/ui/resizable"; +import Sidebar from "./components/view/Sidebar"; export default function App() { const appRef = useRef(null); @@ -21,12 +27,23 @@ export default function App() { } return ( -
+
{appRef.current?.accounts && appRef.current.accounts.accounts.length === 0 ? ( ) : ( - + <> + + + + + + + +
+
+
+ )}
); diff --git a/src/components/ui/resizable.tsx b/src/components/ui/resizable.tsx new file mode 100644 index 0000000..8b139cc --- /dev/null +++ b/src/components/ui/resizable.tsx @@ -0,0 +1,48 @@ +import * as ResizablePrimitive from "react-resizable-panels" + +import { cn } from "@/lib/utils" + +function ResizablePanelGroup({ + className, + ...props +}: ResizablePrimitive.GroupProps) { + return ( + + ) +} + +function ResizablePanel({ ...props }: ResizablePrimitive.PanelProps) { + return +} + +function ResizableHandle({ + withHandle, + className, + ...props +}: ResizablePrimitive.SeparatorProps & { + withHandle?: boolean +}) { + return ( + div]:rotate-90", + className + )} + {...props} + > + {withHandle && ( +
+ )} + + ) +} + +export { ResizableHandle, ResizablePanel, ResizablePanelGroup } diff --git a/src/components/view/Sidebar.tsx b/src/components/view/Sidebar.tsx new file mode 100644 index 0000000..673f006 --- /dev/null +++ b/src/components/view/Sidebar.tsx @@ -0,0 +1,9 @@ +import Enclave from "@/app/app"; + +export default function Sidebar({ + appRef, +}: { + appRef: React.RefObject; +}) { + return
; +}