diff --git a/.changeset/lovely-guests-smell.md b/.changeset/lovely-guests-smell.md new file mode 100644 index 0000000000..ef6bb8c8f4 --- /dev/null +++ b/.changeset/lovely-guests-smell.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-scaffolder': patch +--- + +Use themeId in TemplateCard from theme object diff --git a/plugins/scaffolder/src/components/TemplateCard/TemplateCard.tsx b/plugins/scaffolder/src/components/TemplateCard/TemplateCard.tsx index 9d2e827be9..a02e6d3b14 100644 --- a/plugins/scaffolder/src/components/TemplateCard/TemplateCard.tsx +++ b/plugins/scaffolder/src/components/TemplateCard/TemplateCard.tsx @@ -27,7 +27,7 @@ import { getEntityRelations, getEntitySourceLocation, } from '@backstage/plugin-catalog-react'; -import { BackstageTheme, pageTheme } from '@backstage/theme'; +import { BackstageTheme } from '@backstage/theme'; import { Box, Card, @@ -149,7 +149,9 @@ export const TemplateCard = ({ template, deprecated }: TemplateCardProps) => { template as Entity, RELATION_OWNED_BY, ); - const themeId = pageTheme[templateProps.type] ? templateProps.type : 'other'; + const themeId = backstageTheme.getPageTheme({ themeId: templateProps.type }) + ? templateProps.type + : 'other'; const theme = backstageTheme.getPageTheme({ themeId }); const classes = useStyles({ backgroundImage: theme.backgroundImage }); const href = generatePath(`${rootLink()}/templates/:templateName`, {