feat: add kind names for NIP-29 group events and simplify renderer

- Add kind 39000 (Group), 39001 (Group Admins), 39002 (Group Members)
  to EVENT_KINDS so kind badge displays proper names
- Simplify GroupMetadataRenderer to show only title, description, and
  Open Chat CTA (remove group picture)
This commit is contained in:
Claude
2026-01-12 16:42:27 +00:00
parent ff5ee8dcca
commit 019935928a
2 changed files with 37 additions and 41 deletions

View File

@@ -20,7 +20,6 @@ export function GroupMetadataRenderer({ event }: GroupMetadataRendererProps) {
const groupId = getTagValue(event, "d") || "";
const name = getTagValue(event, "name") || groupId;
const about = getTagValue(event, "about");
const picture = getTagValue(event, "picture");
// Get relay URL from where we saw this event
const seenRelaysSet = getSeenRelays(event);
@@ -43,48 +42,24 @@ export function GroupMetadataRenderer({ event }: GroupMetadataRendererProps) {
return (
<BaseEventContainer event={event}>
<div className="flex gap-3">
{/* Group Picture */}
<div
className={canOpenChat ? "cursor-crosshair" : ""}
onClick={canOpenChat ? handleOpenChat : undefined}
>
{picture ? (
<img
src={picture}
alt={name}
className="size-12 rounded-lg object-cover flex-shrink-0"
/>
) : (
<div className="size-12 rounded-lg bg-muted flex items-center justify-center flex-shrink-0">
<MessageSquare className="size-6 text-muted-foreground" />
</div>
)}
</div>
<div className="flex flex-col gap-1">
<ClickableEventTitle event={event} className="font-semibold">
{name}
</ClickableEventTitle>
{/* Group Info */}
<div className="flex flex-col gap-1 min-w-0 flex-1">
<ClickableEventTitle event={event} className="font-semibold">
{name}
</ClickableEventTitle>
{about && (
<p className="text-xs text-muted-foreground line-clamp-2">{about}</p>
)}
{about && (
<p className="text-xs text-muted-foreground line-clamp-2">
{about}
</p>
)}
{/* Open Chat Link */}
{canOpenChat && (
<button
onClick={handleOpenChat}
className="text-xs text-primary hover:underline flex items-center gap-1 w-fit mt-1"
>
<MessageSquare className="size-3" />
Open Chat
</button>
)}
</div>
{canOpenChat && (
<button
onClick={handleOpenChat}
className="text-xs text-primary hover:underline flex items-center gap-1 w-fit mt-1"
>
<MessageSquare className="size-3" />
Open Chat
</button>
)}
</div>
</BaseEventContainer>
);

View File

@@ -1415,6 +1415,27 @@ export const EVENT_KINDS: Record<number | string, EventKind> = {
nip: "51",
icon: Play,
},
39000: {
kind: 39000,
name: "Group",
description: "Group Metadata",
nip: "29",
icon: Users,
},
39001: {
kind: 39001,
name: "Group Admins",
description: "Group Admins List",
nip: "29",
icon: UserCheck,
},
39002: {
kind: 39002,
name: "Group Members",
description: "Group Members List",
nip: "29",
icon: Users,
},
39701: {
kind: 39701,
name: "Web Bookmark",