File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -58,7 +58,12 @@ export async function fetchAllPatterns(): Promise<{
5858 const patterns = await Promise . all (
5959 catalog . patterns . map ( async ( key ) => {
6060 const pattern = await fetchPattern ( key ) ;
61- return { ...pattern , catalogKey : key } ;
61+ const logo = pattern . logo
62+ ? / ^ h t t p s ? : \/ \/ / . test ( pattern . logo )
63+ ? pattern . logo
64+ : `${ PATTERN_UI_CATALOG_BASE_URL } /${ key } /${ pattern . logo } `
65+ : undefined ;
66+ return { ...pattern , catalogKey : key , logo } ;
6267 } ) ,
6368 ) ;
6469 return {
Original file line number Diff line number Diff line change 99 object-fit : contain;
1010}
1111
12+ .patterns-operator__pattern-logo {
13+ max-height : 32px ;
14+ object-fit : contain;
15+ }
16+
1217.patterns-operator__card-field {
1318 margin-bottom : 4px ;
1419}
Original file line number Diff line number Diff line change @@ -342,7 +342,22 @@ export default function PatternCatalogPage() {
342342 isDisabled ? ' patterns-operator__card--disabled' : ''
343343 } `}
344344 >
345- < CardHeader >
345+ < CardHeader
346+ actions = {
347+ pattern . logo
348+ ? {
349+ actions : (
350+ < img
351+ src = { pattern . logo }
352+ alt = { `${ pattern . display_name } logo` }
353+ className = "patterns-operator__pattern-logo"
354+ />
355+ ) ,
356+ hasNoOffset : true ,
357+ }
358+ : undefined
359+ }
360+ >
346361 < Tooltip content = { TIER_DESCRIPTIONS [ pattern . tier ] || pattern . tier } >
347362 < Label
348363 color = { TIER_COLORS [ pattern . tier ] || 'grey' }
Original file line number Diff line number Diff line change @@ -48,6 +48,7 @@ export interface Pattern {
4848 requirements ?: PatternRequirements ;
4949 extra_features ?: ExtraFeatures ;
5050 external_requirements ?: ExternalRequirements ;
51+ logo ?: string ;
5152 /** The catalog directory key used to fetch this pattern. */
5253 catalogKey ?: string ;
5354}
You can’t perform that action at this time.
0 commit comments