From 0838efc7df7438019d9eb644fcf3efc2591b84d0 Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Fri, 20 Mar 2026 23:03:14 -0500 Subject: [PATCH] Redesign GitRepoCard to mirror GitHub repository card layout Use a GitHub-inspired structure: repo icon + name (as primary-colored link text) + Public/Fork pill badge on the first line, description on the second line, and hashtags rendered as language-dot metadata in a compact bottom row. Clone URL and action buttons follow below. --- src/components/GitRepoCard.tsx | 215 +++++++++++++++++---------------- 1 file changed, 114 insertions(+), 101 deletions(-) diff --git a/src/components/GitRepoCard.tsx b/src/components/GitRepoCard.tsx index 2ffb136f..6aabc014 100644 --- a/src/components/GitRepoCard.tsx +++ b/src/components/GitRepoCard.tsx @@ -1,5 +1,12 @@ import type { NostrEvent } from "@nostrify/nostrify"; -import { Copy, ExternalLink, GitBranch, Globe, Wand2 } from "lucide-react"; +import { + BookMarked, + Copy, + ExternalLink, + GitFork, + Globe, + Wand2, +} from "lucide-react"; import { useState } from "react"; import { Button } from "@/components/ui/button"; @@ -58,38 +65,61 @@ export function GitRepoCard({ event }: GitRepoCardProps) { return (
-
- {/* Header: icon/favicon + title */} -
+
+ {/* Row 1: icon + name + badge */} +
{isApp && faviconUrl && !faviconError ? ( setFaviconError(true)} /> ) : ( - + )} -
-
- - {displayName} + + {displayName} + + {isPersonalFork ? ( + + Fork + + ) : ( + + Public + + )} +
+ + {/* Row 2: description */} + {description && ( +

+ {description} +

+ )} + + {/* Row 3: hashtags as inline metadata (like GitHub's language/stars row) */} + {hashtags.length > 0 && ( +
+ {hashtags.slice(0, 5).map((tag) => ( + + + {tag} + + ))} + {isPersonalFork && ( + + + Fork - {isPersonalFork && ( - - Fork - - )} -
- {description && ( -

- {description} -

)}
-
+ )} {/* Clone URL -- hidden for apps */} {!isApp && cloneUrls[0] && ( @@ -114,90 +144,73 @@ export function GitRepoCard({ event }: GitRepoCardProps) {
)} - {/* Tags */} - {hashtags.length > 0 && ( -
- {hashtags.slice(0, 6).map((tag) => ( - + {hasShakespeare && ( + )} + {isApp ? ( + + ) : webUrls[0] ? ( + + ) : !hasShakespeare && cloneUrls[0] ? ( + + ) : null}
)} - - {/* Action buttons */} -
- {hasShakespeare && ( - - )} - {isApp ? ( - - ) : webUrls[0] ? ( - - ) : !hasShakespeare && cloneUrls[0] ? ( - - ) : null} -
);