From 3324f4487a8ff8f1a8317776775255ec013b07a7 Mon Sep 17 00:00:00 2001 From: MohamedBassem Date: Sat, 2 Mar 2024 14:33:44 +0000 Subject: feature: Add 'New List' button in the all lists page --- .../web/app/dashboard/lists/components/AllListsView.tsx | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'packages/web/app/dashboard/lists/components') diff --git a/packages/web/app/dashboard/lists/components/AllListsView.tsx b/packages/web/app/dashboard/lists/components/AllListsView.tsx index 7c8a9e56..155cdbcf 100644 --- a/packages/web/app/dashboard/lists/components/AllListsView.tsx +++ b/packages/web/app/dashboard/lists/components/AllListsView.tsx @@ -1,10 +1,13 @@ "use client"; +import { Button } from "@/components/ui/button"; import LoadingSpinner from "@/components/ui/spinner"; import { api } from "@/lib/trpc"; import { ZBookmarkList } from "@/lib/types/api/lists"; import { keepPreviousData } from "@tanstack/react-query"; +import { Plus } from "lucide-react"; import Link from "next/link"; +import { useNewListModal } from "../../components/NewListModal"; function ListItem({ name, @@ -31,6 +34,7 @@ export default function AllListsView({ }: { initialData: ZBookmarkList[]; }) { + const { setOpen: setIsNewListModalOpen } = useNewListModal(); const { data: lists } = api.lists.list.useQuery(undefined, { initialData: { lists: initialData }, placeholderData: keepPreviousData, @@ -41,7 +45,14 @@ export default function AllListsView({ } return ( -
+
+ {lists.lists.map((l) => ( -- cgit v1.2.3-70-g09d2