Skip to content

Commit b685f36

Browse files
authored
feat(react): use favicon on connected source list items (#226)
* feat(react): use favicon on connected source list items Replace the generic SVG icon in the connected sources list with SourceFavicon, which renders the site's actual favicon from the source URL. * fix(react): match favicon size to popular sources list (20px) * fix(react): match favicon size to CardStackEntryMedia container (32px)
1 parent bdf736b commit b685f36

1 file changed

Lines changed: 3 additions & 9 deletions

File tree

‎packages/react/src/pages/sources.tsx‎

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import {
2020
CardStackEntryDescription,
2121
CardStackEntryActions,
2222
} from "../components/card-stack";
23+
import { SourceFavicon } from "../components/source-favicon";
2324

2425
const KIND_TO_PLUGIN_KEY: Record<string, string> = {
2526
openapi: "openapi",
@@ -267,6 +268,7 @@ function SourceGrid(props: {
267268
id: string;
268269
name: string;
269270
kind: string;
271+
url?: string;
270272
runtime?: boolean;
271273
}[];
272274
}) {
@@ -278,15 +280,7 @@ function SourceGrid(props: {
278280
<CardStackEntry key={s.id} asChild searchText={`${s.name} ${s.id} ${s.kind}`}>
279281
<Link to="/sources/$namespace" params={{ namespace: s.id }}>
280282
<CardStackEntryMedia>
281-
<svg viewBox="0 0 16 16" className="size-3.5" fill="none">
282-
<circle cx="8" cy="8" r="6" stroke="currentColor" strokeWidth="1.2" />
283-
<path
284-
d="M8 5v6M5 8h6"
285-
stroke="currentColor"
286-
strokeWidth="1.2"
287-
strokeLinecap="round"
288-
/>
289-
</svg>
283+
<SourceFavicon url={s.url} size={32} />
290284
</CardStackEntryMedia>
291285
<CardStackEntryContent>
292286
<CardStackEntryTitle>{s.name}</CardStackEntryTitle>

0 commit comments

Comments
 (0)