Fixed code duplication
This commit is contained in:
parent
f41f612372
commit
02eef1464c
@ -45,7 +45,11 @@ const Bookmarks = ({ pubkey, bookmarks, related }: BookmarksProps) => {
|
||||
.filter(b => (onlyPubkey === "all" ? true : b.pubkey === onlyPubkey))
|
||||
.map(n => {
|
||||
switch (n.kind) {
|
||||
case EventKind.TextNote:
|
||||
case EventKind.Reaction:
|
||||
case EventKind.Repost:
|
||||
case EventKind.ZapReceipt:
|
||||
return <NoteReaction data={n} key={n.id} />;
|
||||
default:
|
||||
return (
|
||||
<Note
|
||||
key={n.id}
|
||||
@ -54,19 +58,7 @@ const Bookmarks = ({ pubkey, bookmarks, related }: BookmarksProps) => {
|
||||
options={{ showTime: false, showBookmarked: true, canUnbookmark: loginPubKey === pubkey }}
|
||||
/>
|
||||
);
|
||||
case EventKind.Reaction:
|
||||
case EventKind.Repost:
|
||||
case EventKind.ZapReceipt:
|
||||
return <NoteReaction data={n} key={n.id} />;
|
||||
}
|
||||
return (
|
||||
<Note
|
||||
key={n.id}
|
||||
data={n}
|
||||
related={related}
|
||||
options={{ showTime: false, showBookmarked: true, canUnbookmark: loginPubKey === pubkey }}
|
||||
/>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
);
|
||||
|
Loading…
x
Reference in New Issue
Block a user