From dce7166a91a86c749a4274431f3e6b79b7af7b32 Mon Sep 17 00:00:00 2001 From: Ishaan Dey Date: Mon, 8 Apr 2024 23:40:42 -0400 Subject: [PATCH] tab ui --- app/page.tsx | 3 +- components/editor/index.tsx | 68 +++++++++++++++++++------------------ components/navbar/index.tsx | 14 ++++++++ components/ui/tab.tsx | 31 +++++++++++++++++ 4 files changed, 82 insertions(+), 34 deletions(-) create mode 100644 components/navbar/index.tsx create mode 100644 components/ui/tab.tsx diff --git a/app/page.tsx b/app/page.tsx index afb292b..43a025b 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -1,3 +1,4 @@ +import Navbar from "@/components/navbar" import dynamic from "next/dynamic" import Image from "next/image" @@ -8,7 +9,7 @@ const CodeEditor = dynamic(() => import("@/components/editor"), { export default function Home() { return (
-
NAVBAR
+
diff --git a/components/editor/index.tsx b/components/editor/index.tsx index abc0aa0..d6b6aae 100644 --- a/components/editor/index.tsx +++ b/components/editor/index.tsx @@ -11,7 +11,16 @@ import { ResizablePanelGroup, } from "@/components/ui/resizable" import { Button } from "../ui/button" -import { X } from "lucide-react" +import { + ChevronLeft, + ChevronRight, + RotateCcw, + RotateCw, + Terminal, + TerminalSquare, + X, +} from "lucide-react" +import Tab from "../ui/tab" export default function CodeEditor() { const editorRef = useRef(null) @@ -65,22 +74,10 @@ export default function CodeEditor() { defaultSize={60} >
- - + index.html + style.css
-
+
-
- +
+
+ Preview +
+
+ +
+
+ +
+
+ +
+
+ +
+
+
-
+
- + Node + Console
-
+
diff --git a/components/navbar/index.tsx b/components/navbar/index.tsx new file mode 100644 index 0000000..54eb114 --- /dev/null +++ b/components/navbar/index.tsx @@ -0,0 +1,14 @@ +import { ChevronLeft, Home } from "lucide-react" +import { Button } from "../ui/button" + +export default function Navbar() { + return ( +
+
+ +
+
+ ) +} diff --git a/components/ui/tab.tsx b/components/ui/tab.tsx new file mode 100644 index 0000000..11ca1df --- /dev/null +++ b/components/ui/tab.tsx @@ -0,0 +1,31 @@ +"use client" + +import { X } from "lucide-react" +import { Button } from "./button" + +export default function Tab({ + children, + onClick, + onClose, +}: { + children: React.ReactNode + onClick?: () => void + onClose?: () => void +}) { + return ( + + ) +}