From fe13408831dce4bdae4911098d6079a097cae9e8 Mon Sep 17 00:00:00 2001
From: MohamedBassem <me@mbassem.com>
Date: Tue, 9 Apr 2024 15:49:24 +0100
Subject: feature(web): Allow uploading directly into lists/tags. Fixes #69

---
 .../components/dashboard/bookmarks/UpdatableBookmarksGrid.tsx  | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

(limited to 'apps/web/components/dashboard/bookmarks/UpdatableBookmarksGrid.tsx')

diff --git a/apps/web/components/dashboard/bookmarks/UpdatableBookmarksGrid.tsx b/apps/web/components/dashboard/bookmarks/UpdatableBookmarksGrid.tsx
index a344320e..fe69201c 100644
--- a/apps/web/components/dashboard/bookmarks/UpdatableBookmarksGrid.tsx
+++ b/apps/web/components/dashboard/bookmarks/UpdatableBookmarksGrid.tsx
@@ -1,11 +1,13 @@
 "use client";
 
+import UploadDropzone from "@/components/dashboard/UploadDropzone";
 import { api } from "@/lib/trpc";
 
 import type {
   ZGetBookmarksRequest,
   ZGetBookmarksResponse,
 } from "@hoarder/trpc/types/bookmarks";
+import { BookmarkGridContextProvider } from "@hoarder/shared-react/hooks/bookmark-grid-context";
 
 import BookmarksGrid from "./BookmarksGrid";
 
@@ -29,7 +31,7 @@ export default function UpdatableBookmarksGrid({
       getNextPageParam: (lastPage) => lastPage.nextCursor,
     });
 
-  return (
+  const grid = (
     <BookmarksGrid
       bookmarks={data!.pages.flatMap((b) => b.bookmarks)}
       hasNextPage={hasNextPage}
@@ -38,4 +40,10 @@ export default function UpdatableBookmarksGrid({
       showEditorCard={showEditorCard}
     />
   );
+
+  return (
+    <BookmarkGridContextProvider query={query}>
+      {showEditorCard ? <UploadDropzone>{grid}</UploadDropzone> : grid}
+    </BookmarkGridContextProvider>
+  );
 }
-- 
cgit v1.2.3-70-g09d2

