From 4f17ea61cbb11a72712a1ea8c98904a1cc513e41 Mon Sep 17 00:00:00 2001 From: Mohamed Bassem Date: Sun, 14 Apr 2024 00:51:56 +0300 Subject: feature(web): Allow changing the bookmark grid layout (#98) --- .../components/dashboard/bookmarks/TextCard.tsx | 54 ++++++++++++---------- 1 file changed, 30 insertions(+), 24 deletions(-) (limited to 'apps/web/components/dashboard/bookmarks/TextCard.tsx') diff --git a/apps/web/components/dashboard/bookmarks/TextCard.tsx b/apps/web/components/dashboard/bookmarks/TextCard.tsx index 42d09c23..c715c8ab 100644 --- a/apps/web/components/dashboard/bookmarks/TextCard.tsx +++ b/apps/web/components/dashboard/bookmarks/TextCard.tsx @@ -3,14 +3,14 @@ import { useState } from "react"; import { isBookmarkStillTagging } from "@/lib/bookmarkUtils"; import { api } from "@/lib/trpc"; +import { bookmarkLayoutSwitch } from "@/lib/userLocalSettings/bookmarksLayout"; import { cn } from "@/lib/utils"; import Markdown from "react-markdown"; import type { ZBookmark } from "@hoarder/trpc/types/bookmarks"; -import BookmarkActionBar from "./BookmarkActionBar"; import { BookmarkedTextViewer } from "./BookmarkedTextViewer"; -import TagList from "./TagList"; +import { BookmarkLayoutAdaptingCard } from "./BookmarkLayoutAdaptingCard"; export default function TextCard({ bookmark: initialData, @@ -50,28 +50,34 @@ export default function TextCard({ open={previewModalOpen} setOpen={setPreviewModalOpen} /> -
- - {bookmarkedText.text} - -
- -
-
-
- -
-
+ + {bookmarkedText.text} + + } + footer={null} + wrapTags={true} + bookmark={bookmark} + className={className} + fitHeight={true} + image={(layout, className) => + bookmarkLayoutSwitch(layout, { + grid: null, + masonry: null, + list: ( +
+ Note +
+ ), + }) + } + /> ); } -- cgit v1.2.3-70-g09d2