From f61630619a636cd614adedd65fcdabef393c9fd5 Mon Sep 17 00:00:00 2001 From: vivganes Date: Sat, 8 Apr 2023 15:05:34 +0530 Subject: [PATCH] filtering moved to ProfilePage --- packages/app/src/Element/Bookmarks.tsx | 23 +++++++++-------------- packages/app/src/Pages/ProfilePage.tsx | 8 +++++++- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/packages/app/src/Element/Bookmarks.tsx b/packages/app/src/Element/Bookmarks.tsx index 157d1c58..5ce8f5bc 100644 --- a/packages/app/src/Element/Bookmarks.tsx +++ b/packages/app/src/Element/Bookmarks.tsx @@ -18,7 +18,7 @@ const Bookmarks = ({ pubkey, bookmarks, related }: BookmarksProps) => { const [onlyPubkey, setOnlyPubkey] = useState("all"); const loginPubKey = useSelector((s: RootState) => s.login.publicKey); const ps = useMemo(() => { - return [...new Set(bookmarks.filter(ev => ev.kind === EventKind.TextNote).map(ev => ev.pubkey))]; + return [...new Set(bookmarks.map(ev => ev.pubkey))]; }, [bookmarks]); function renderOption(p: HexKey) { @@ -42,19 +42,14 @@ const Bookmarks = ({ pubkey, bookmarks, related }: BookmarksProps) => { {bookmarks .filter(b => (onlyPubkey === "all" ? true : b.pubkey === onlyPubkey)) .map(n => { - switch (n.kind) { - case EventKind.TextNote: - return ( - - ); - default: - return null; - } + return ( + + ); })} ); diff --git a/packages/app/src/Pages/ProfilePage.tsx b/packages/app/src/Pages/ProfilePage.tsx index 970c8904..3acee76a 100644 --- a/packages/app/src/Pages/ProfilePage.tsx +++ b/packages/app/src/Pages/ProfilePage.tsx @@ -91,7 +91,13 @@ function RelaysTab({ id }: { id: HexKey }) { function BookMarksTab({ id }: { id: HexKey }) { const bookmarks = useBookmarkFeed(id); - return ; + return ( + e.kind === EventKind.TextNote)} + related={bookmarks.filter(e => e.kind !== EventKind.TextNote)} + /> + ); } export default function ProfilePage() {