From e0999f701cd1834c3d940113cd8dd5247c5fe95f Mon Sep 17 00:00:00 2001 From: Mohamed Bassem Date: Fri, 19 Apr 2024 00:09:27 +0100 Subject: feature: Nested lists (#110). Fixes #62 * feature: Add support for nested lists * prevent moving the parent to a subtree --- .../web/components/dashboard/lists/ListOptions.tsx | 71 ++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 apps/web/components/dashboard/lists/ListOptions.tsx (limited to 'apps/web/components/dashboard/lists/ListOptions.tsx') diff --git a/apps/web/components/dashboard/lists/ListOptions.tsx b/apps/web/components/dashboard/lists/ListOptions.tsx new file mode 100644 index 00000000..b44d8a23 --- /dev/null +++ b/apps/web/components/dashboard/lists/ListOptions.tsx @@ -0,0 +1,71 @@ +"use client"; + +import { useState } from "react"; +import { + DropdownMenu, + DropdownMenuContent, + DropdownMenuItem, + DropdownMenuTrigger, +} from "@/components/ui/dropdown-menu"; +import { Pencil, Plus, Trash2 } from "lucide-react"; + +import { ZBookmarkList } from "@hoarder/shared/types/lists"; + +import { EditListModal } from "../lists/EditListModal"; +import DeleteListConfirmationDialog from "./DeleteListConfirmationDialog"; + +export function ListOptions({ + list, + children, +}: { + list: ZBookmarkList; + children?: React.ReactNode; +}) { + const [deleteListDialogOpen, setDeleteListDialogOpen] = useState(false); + const [newNestedListModalOpen, setNewNestedListModalOpen] = useState(false); + const [editModalOpen, setEditModalOpen] = useState(false); + + return ( + + + + + {children} + + setEditModalOpen(true)} + > + + Edit + + setNewNestedListModalOpen(true)} + > + + New nested list + + setDeleteListDialogOpen(true)} + > + + Delete + + + + ); +} -- cgit v1.2.3-70-g09d2