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 @@ -341,7 +341,22 @@ export default function PatternCatalogPage() {
341341 isDisabled ? ' patterns-operator__card--disabled' : ''
342342 } `}
343343 >
344- < CardHeader >
344+ < CardHeader
345+ actions = {
346+ pattern . logo
347+ ? {
348+ actions : (
349+ < img
350+ src = { pattern . logo }
351+ alt = { `${ pattern . display_name } logo` }
352+ className = "patterns-operator__pattern-logo"
353+ />
354+ ) ,
355+ hasNoOffset : true ,
356+ }
357+ : undefined
358+ }
359+ >
345360 < Tooltip content = { TIER_DESCRIPTIONS [ pattern . tier ] || pattern . tier } >
346361 < Label
347362 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