diff --git a/src/components/BookmarkList.tsx b/src/components/BookmarkList.tsx index 4d897ee8..2caced83 100644 --- a/src/components/BookmarkList.tsx +++ b/src/components/BookmarkList.tsx @@ -3,7 +3,6 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import { faChevronLeft, faBookmark, faSpinner, faList, faThLarge, faImage } from '@fortawesome/free-solid-svg-icons' import { Bookmark } from '../types/bookmarks' import { BookmarkItem } from './BookmarkItem' -import { formatDate, renderParsedContent } from '../utils/bookmarkUtils' import SidebarHeader from './SidebarHeader' import IconButton from './IconButton' import { ViewMode } from './Bookmarks' @@ -37,6 +36,11 @@ export const BookmarkList: React.FC = ({ isRefreshing, loading = false }) => { + // Merge and flatten all individual bookmarks from all lists + // They're already sorted by date in the service layer + const allIndividualBookmarks = bookmarks.flatMap(b => b.individualBookmarks || []) + .filter(ib => ib.content || ib.kind === 30023 || ib.kind === 39701) + if (isCollapsed) { // Check if the selected URL is in bookmarks const isBookmarked = selectedUrl && bookmarks.some(bookmark => { @@ -73,73 +77,24 @@ export const BookmarkList: React.FC = ({
- ) : bookmarks.length === 0 ? ( + ) : allIndividualBookmarks.length === 0 ? (

No bookmarks found.

Add bookmarks using your nostr client to see them here.

) : (
- {bookmarks.map((bookmark, index) => ( -
- {bookmark.bookmarkCount && ( -

- {bookmark.bookmarkCount} bookmarks in{' '} - - this list - - : -

- )} - {bookmark.urlReferences && bookmark.urlReferences.length > 0 && ( -
-

URLs:

- {bookmark.urlReferences.map((url, index) => ( - - {url} - - ))} -
- )} - {bookmark.individualBookmarks && bookmark.individualBookmarks.length > 0 && ( -
-
- {bookmark.individualBookmarks - .filter(ib => ib.content || ib.kind === 30023 || ib.kind === 39701) - .map((individualBookmark, index) => - - )} -
-
- )} - {bookmark.eventReferences && bookmark.eventReferences.length > 0 && bookmark.individualBookmarks?.length === 0 && ( -
-

Event References ({bookmark.eventReferences.length}):

-
- {bookmark.eventReferences.slice(0, 3).map((eventId, index) => ( - - {eventId.slice(0, 8)}...{eventId.slice(-8)} - - ))} - {bookmark.eventReferences.length > 3 && ( - ... and {bookmark.eventReferences.length - 3} more - )} -
-
- )} -
- ))} +
+ {allIndividualBookmarks.map((individualBookmark, index) => + + )} +
)}