diff options
| author | MohamedBassem <me@mbassem.com> | 2024-04-15 18:39:59 +0100 |
|---|---|---|
| committer | MohamedBassem <me@mbassem.com> | 2024-04-15 18:55:34 +0100 |
| commit | 81e0b2849d837649da9adbc5d077b8c819fe7bee (patch) | |
| tree | 003bb21413372825dc19c07a87bdbe6692e384a9 /apps/web/components/dashboard/bookmarks | |
| parent | 5c9acb1cb3bfe341378b91bbed344dd7202a00d7 (diff) | |
| download | karakeep-81e0b2849d837649da9adbc5d077b8c819fe7bee.tar.zst | |
feature: Add title to bookmarks and allow editing them. Fixes #27
Diffstat (limited to 'apps/web/components/dashboard/bookmarks')
| -rw-r--r-- | apps/web/components/dashboard/bookmarks/AssetCard.tsx | 2 | ||||
| -rw-r--r-- | apps/web/components/dashboard/bookmarks/LinkCard.tsx | 2 | ||||
| -rw-r--r-- | apps/web/components/dashboard/bookmarks/TextCard.tsx | 1 |
3 files changed, 3 insertions, 2 deletions
diff --git a/apps/web/components/dashboard/bookmarks/AssetCard.tsx b/apps/web/components/dashboard/bookmarks/AssetCard.tsx index 3bda1ee8..ea0317aa 100644 --- a/apps/web/components/dashboard/bookmarks/AssetCard.tsx +++ b/apps/web/components/dashboard/bookmarks/AssetCard.tsx @@ -80,7 +80,7 @@ export default function AssetCard({ return ( <BookmarkLayoutAdaptingCard - title={bookmarkedAsset.content.fileName} + title={bookmarkedAsset.title ?? bookmarkedAsset.content.fileName} footer={null} bookmark={bookmarkedAsset} className={className} diff --git a/apps/web/components/dashboard/bookmarks/LinkCard.tsx b/apps/web/components/dashboard/bookmarks/LinkCard.tsx index 5c329424..6d51695d 100644 --- a/apps/web/components/dashboard/bookmarks/LinkCard.tsx +++ b/apps/web/components/dashboard/bookmarks/LinkCard.tsx @@ -16,7 +16,7 @@ function LinkTitle({ bookmark }: { bookmark: ZBookmarkTypeLink }) { const parsedUrl = new URL(link.url); return ( <Link className="line-clamp-2" href={link.url} target="_blank"> - {link?.title ?? parsedUrl.host} + {bookmark.title ?? link?.title ?? parsedUrl.host} </Link> ); } diff --git a/apps/web/components/dashboard/bookmarks/TextCard.tsx b/apps/web/components/dashboard/bookmarks/TextCard.tsx index c715c8ab..e24108d2 100644 --- a/apps/web/components/dashboard/bookmarks/TextCard.tsx +++ b/apps/web/components/dashboard/bookmarks/TextCard.tsx @@ -51,6 +51,7 @@ export default function TextCard({ setOpen={setPreviewModalOpen} /> <BookmarkLayoutAdaptingCard + title={bookmark.title} content={ <Markdown className="prose dark:prose-invert"> {bookmarkedText.text} |
