From db893d4f97aee5ca0baa7a8a11808fae567b2b8f Mon Sep 17 00:00:00 2001 From: Thomas Camlong Date: Wed, 1 Oct 2025 18:22:42 +0200 Subject: [PATCH] feat(web): add support for community icons in icon card Update IconCard component to handle both regular icons and community-submitted icons. Community icons use HTTP URLs as image source and link to /community/:name instead of /icons/:name for proper routing --- web/src/components/icon-card.tsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/web/src/components/icon-card.tsx b/web/src/components/icon-card.tsx index c8fe1e0a..bc7af1b3 100644 --- a/web/src/components/icon-card.tsx +++ b/web/src/components/icon-card.tsx @@ -7,12 +7,20 @@ import type { Icon } from "@/types/icons" export function IconCard({ name, data: iconData, matchedAlias }: { name: string; data: Icon; matchedAlias?: string }) { const formatedIconName = formatIconName(name) + + const isCommunityIcon = iconData.base.startsWith("http") + const imageUrl = isCommunityIcon + ? iconData.base + : `${BASE_URL}/${iconData.base}/${iconData.colors?.light || name}.${iconData.base}` + + const linkHref = isCommunityIcon ? `/community/${name}` : `/icons/${name}` + return ( - +