From 69858828fa0eeaaa3bd2f457b40927c2d7d167ad Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 17 Jan 2026 18:42:36 +0000 Subject: [PATCH] refactor: Improve Profile Badges UX Feed view: - Show all badge thumbnails (removed 4-badge limit) - Entire feed item is clickable to open detail view - Badge count displayed inline Detail view: - Change from grid to vertical list layout - Show one badge per row with horizontal layout - Display: awarded by author, badge image, name, and description - Better readability for badge information --- .../kinds/ProfileBadgesDetailRenderer.tsx | 72 +++++++++---------- .../nostr/kinds/ProfileBadgesRenderer.tsx | 30 ++++---- 2 files changed, 44 insertions(+), 58 deletions(-) diff --git a/src/components/nostr/kinds/ProfileBadgesDetailRenderer.tsx b/src/components/nostr/kinds/ProfileBadgesDetailRenderer.tsx index 367ca0f..c67d02b 100644 --- a/src/components/nostr/kinds/ProfileBadgesDetailRenderer.tsx +++ b/src/components/nostr/kinds/ProfileBadgesDetailRenderer.tsx @@ -35,9 +35,9 @@ function parseAddress(aTagValue: string): AddressPointer | null { } /** - * Single badge card component with image, name, and description + * Single badge row component with author, image, name, and description */ -function BadgeCard({ +function BadgeRow({ badgeAddress, awardEventId, }: { @@ -70,63 +70,55 @@ function BadgeCard({ const displayTitle = badgeName || badgeIdentifier || "Badge"; return ( -
+
{/* Badge Image */} -
- {badgeImageUrl ? ( - {displayTitle} - ) : ( -
- -
- )} -
+ {badgeImageUrl ? ( + {displayTitle} + ) : ( +
+ +
+ )} {/* Badge Info */} -
+
+ {/* Awarded by */} +
+ Awarded by + {awardEvent && } +
+ + {/* Badge Name */} {badgeEvent ? ( {displayTitle} ) : ( -

+

{displayTitle}

)} + {/* Badge Description */} {badgeDescription && ( -

- {badgeDescription} -

+

{badgeDescription}

)}
- - {/* Award Info */} - {awardEvent && ( -
-

- Awarded by -

-
- -
-
- )}
); } /** * Detail renderer for Kind 30008 - Profile Badges (NIP-58) - * Shows all badges in a grid layout + * Shows all badges in a vertical list */ export function ProfileBadgesDetailRenderer({ event, @@ -134,7 +126,7 @@ export function ProfileBadgesDetailRenderer({ const badgePairs = getProfileBadgePairs(event); return ( -
+
{/* Header */}

Profile Badges

@@ -147,11 +139,11 @@ export function ProfileBadgesDetailRenderer({
- {/* Badges Grid */} + {/* Badges List */} {badgePairs.length > 0 ? ( -
+
{badgePairs.map((pair, idx) => ( - -
- {/* Badge Icons */} -
- {visibleBadges.map((pair, idx) => ( - - ))} -
+ + {/* All Badge Thumbnails */} + {badgePairs.map((pair, idx) => ( + + ))} {/* Badge Count */} - + {badgePairs.length} {badgePairs.length === 1 ? "badge" : "badges"} - {remainingCount > 0 && ` (${remainingCount} more)`} - -
+ + ); }