feat: badges

- render badges in cards
- render mentioned badges in chat
- render host badge awards in chat
- render accepted badges next to username
This commit is contained in:
2023-07-31 20:42:43 +02:00
parent 1baecf41f2
commit 7a030c9e53
14 changed files with 291 additions and 42 deletions

View File

@ -1,8 +1,9 @@
import { type NostrLink } from "@snort/system";
import { type NostrLink, EventKind } from "@snort/system";
import { useEvent } from "hooks/event";
import { EMOJI_PACK } from "const";
import { EmojiPack } from "element/emoji-pack";
import { Badge } from "element/badge";
interface AddressProps {
link: NostrLink;
@ -15,5 +16,9 @@ export function Address({ link }: AddressProps) {
return <EmojiPack ev={event} />;
}
if (event?.kind === EventKind.Badge) {
return <Badge ev={event} />;
}
return null;
}