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