From e18c3e26d71e27a46d5058cfe59b12e6892426a0 Mon Sep 17 00:00:00 2001 From: bkellam Date: Sat, 24 Aug 2024 23:01:46 -0700 Subject: [PATCH] Code panel skeleton --- package.json | 1 + src/app/page.tsx | 29 ++++++++++++++++----- src/components/ui/resizable.tsx | 45 +++++++++++++++++++++++++++++++++ yarn.lock | 5 ++++ 4 files changed, 74 insertions(+), 6 deletions(-) create mode 100644 src/components/ui/resizable.tsx diff --git a/package.json b/package.json index 72ef853c..5a03ddcf 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,7 @@ "next": "14.2.6", "react": "^18", "react-dom": "^18", + "react-resizable-panels": "^2.1.1", "tailwind-merge": "^2.5.2", "tailwindcss-animate": "^1.0.7", "use-debounce": "^10.0.3" diff --git a/src/app/page.tsx b/src/app/page.tsx index 2dd2dbee..a7d713b3 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -9,6 +9,12 @@ import { Separator } from "@/components/ui/separator" import { useRouter } from "next/navigation"; import { useNonEmptyQueryParam } from "@/hooks/useNonEmptyQueryParam"; import { SymbolIcon } from "@radix-ui/react-icons"; +import { ScrollArea, Scrollbar } from "@radix-ui/react-scroll-area"; +import { + ResizableHandle, + ResizablePanel, + ResizablePanelGroup, + } from "@/components/ui/resizable" interface ZoekMatch { URL: string, @@ -58,7 +64,7 @@ export default function Home() { // Currently we do not re-query. return ( -
+
-
- {fileMatches.map((match, index) => ( - - ))} -
+ + + +
+ {fileMatches.map((match, index) => ( + + ))} +
+ +
+
+ + +

CODE EDITOR

+
+
); } diff --git a/src/components/ui/resizable.tsx b/src/components/ui/resizable.tsx new file mode 100644 index 00000000..f4bc5586 --- /dev/null +++ b/src/components/ui/resizable.tsx @@ -0,0 +1,45 @@ +"use client" + +import { GripVertical } from "lucide-react" +import * as ResizablePrimitive from "react-resizable-panels" + +import { cn } from "@/lib/utils" + +const ResizablePanelGroup = ({ + className, + ...props +}: React.ComponentProps) => ( + +) + +const ResizablePanel = ResizablePrimitive.Panel + +const ResizableHandle = ({ + withHandle, + className, + ...props +}: React.ComponentProps & { + withHandle?: boolean +}) => ( + div]:rotate-90", + className + )} + {...props} + > + {withHandle && ( +
+ +
+ )} +
+) + +export { ResizablePanelGroup, ResizablePanel, ResizableHandle } diff --git a/yarn.lock b/yarn.lock index 1049bbe4..a53d4840 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2244,6 +2244,11 @@ react-is@^16.13.1: resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ== +react-resizable-panels@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/react-resizable-panels/-/react-resizable-panels-2.1.1.tgz#efcf4ee0d7b45d9617db2f2e3de1ca04589e6b7f" + integrity sha512-+cUV/yZBYfiBj+WJtpWDJ3NtR4zgDZfHt3+xtaETKE+FCvp+RK/NJxacDQKxMHgRUTSkfA6AnGljQ5QZNsCQoA== + react@^18: version "18.3.1" resolved "https://registry.yarnpkg.com/react/-/react-18.3.1.tgz#49ab892009c53933625bd16b2533fc754cab2891"