From 5045c4ce9ad681264028acd3f88f836d08184009 Mon Sep 17 00:00:00 2001 From: Ishaan Dey Date: Thu, 18 Apr 2024 14:42:47 -0400 Subject: [PATCH] separate dashboard page components --- frontend/components/dashboard/index.tsx | 39 +----- .../dashboard/projectCard/dropdown.tsx | 8 +- .../dashboard/projectCard/index.tsx | 9 +- frontend/components/dashboard/projects.tsx | 47 +++++++ frontend/components/dashboard/shared.tsx | 71 +++++++++++ frontend/components/ui/customButton.tsx | 3 +- frontend/components/ui/table.tsx | 120 ++++++++++++++++++ 7 files changed, 259 insertions(+), 38 deletions(-) create mode 100644 frontend/components/dashboard/projects.tsx create mode 100644 frontend/components/dashboard/shared.tsx create mode 100644 frontend/components/ui/table.tsx diff --git a/frontend/components/dashboard/index.tsx b/frontend/components/dashboard/index.tsx index 8cd2724..46f38e2 100644 --- a/frontend/components/dashboard/index.tsx +++ b/frontend/components/dashboard/index.tsx @@ -18,6 +18,8 @@ import ProjectCard from "./projectCard" import { Sandbox } from "@/lib/types" import Image from "next/image" import ProjectCardDropdown from "./projectCard/dropdown" +import DashboardProjects from "./projects" +import DashboardSharedWithMe from "./shared" type TScreen = "projects" | "shared" | "settings" | "search" @@ -51,7 +53,7 @@ export default function Dashboard({ sandboxes }: { sandboxes: Sandbox[] }) { className={activeScreen("shared")} > - Shared Rooms + Shared With Me ) diff --git a/frontend/components/ui/table.tsx b/frontend/components/ui/table.tsx new file mode 100644 index 0000000..c0df655 --- /dev/null +++ b/frontend/components/ui/table.tsx @@ -0,0 +1,120 @@ +import * as React from "react" + +import { cn } from "@/lib/utils" + +const Table = React.forwardRef< + HTMLTableElement, + React.HTMLAttributes +>(({ className, ...props }, ref) => ( +
+ + +)) +Table.displayName = "Table" + +const TableHeader = React.forwardRef< + HTMLTableSectionElement, + React.HTMLAttributes +>(({ className, ...props }, ref) => ( + +)) +TableHeader.displayName = "TableHeader" + +const TableBody = React.forwardRef< + HTMLTableSectionElement, + React.HTMLAttributes +>(({ className, ...props }, ref) => ( + +)) +TableBody.displayName = "TableBody" + +const TableFooter = React.forwardRef< + HTMLTableSectionElement, + React.HTMLAttributes +>(({ className, ...props }, ref) => ( + tr]:last:border-b-0", + className + )} + {...props} + /> +)) +TableFooter.displayName = "TableFooter" + +const TableRow = React.forwardRef< + HTMLTableRowElement, + React.HTMLAttributes +>(({ className, ...props }, ref) => ( + +)) +TableRow.displayName = "TableRow" + +const TableHead = React.forwardRef< + HTMLTableCellElement, + React.ThHTMLAttributes +>(({ className, ...props }, ref) => ( +
[role=checkbox]]:translate-y-[2px]", + className + )} + {...props} + /> +)) +TableHead.displayName = "TableHead" + +const TableCell = React.forwardRef< + HTMLTableCellElement, + React.TdHTMLAttributes +>(({ className, ...props }, ref) => ( + [role=checkbox]]:translate-y-[2px]", + className + )} + {...props} + /> +)) +TableCell.displayName = "TableCell" + +const TableCaption = React.forwardRef< + HTMLTableCaptionElement, + React.HTMLAttributes +>(({ className, ...props }, ref) => ( +
+)) +TableCaption.displayName = "TableCaption" + +export { + Table, + TableHeader, + TableBody, + TableFooter, + TableHead, + TableRow, + TableCell, + TableCaption, +}