diff --git a/src/components/MaintainerCard.tsx b/src/components/MaintainerCard.tsx index f727f286..ec995c36 100644 --- a/src/components/MaintainerCard.tsx +++ b/src/components/MaintainerCard.tsx @@ -113,6 +113,80 @@ function LibraryBadge({ library }: { library: Library }) { ) } +const MaintainerSocialIcons: Record< + keyof Maintainer['social'], + React.ReactNode +> = { + twitter: ( + + ), + bluesky: ( + + ), + website: ( + + ), + github: ( + + ), +} + +function MaintainerSocialLinks({ maintainer }: { maintainer: Maintainer }) { + const links = Object.entries({ + github: `https://github.com/${maintainer.github}`, + ...(maintainer.social || {}), + }).map(([key, value]) => { + const Icon = MaintainerSocialIcons[key as keyof Maintainer['social']] + return ( + e.stopPropagation()} + className="hover:text-gray-700 dark:hover:text-gray-200 transition-colors p-2 -mb-2 -ml-2 hover:grayscale-0 hover:scale-110" + > + {Icon} + + ) + }) + + return ( +
+ {links} +
+ ) +} + interface MaintainerCardProps { maintainer: Maintainer libraryId?: Library['id'] @@ -205,77 +279,7 @@ export function MaintainerCard({ maintainer, libraryId }: MaintainerCardProps) { )} )} -
- e.stopPropagation()} - > - - - {maintainer.social?.twitter && ( - e.stopPropagation()} - > - - - )} - {maintainer.social?.bluesky && ( - e.stopPropagation()} - > - - - )} - {maintainer.social?.website && ( - e.stopPropagation()} - > - - - )} -
+ ) diff --git a/src/routes/_libraries/index.tsx b/src/routes/_libraries/index.tsx index fbcf1288..7d3fe5ce 100644 --- a/src/routes/_libraries/index.tsx +++ b/src/routes/_libraries/index.tsx @@ -388,7 +388,7 @@ function Index() {

Core Maintainers

-
+
{coreMaintainers.map((maintainer) => ( ))}