Make ownership card style customizable via custom theme.getPageTheme()

Signed-off-by: Oliver Sand <oliver.sand@sda-se.com>
This commit is contained in:
Oliver Sand
2021-09-07 15:08:31 +02:00
parent 96f239228a
commit 6ad8fe1a0a
2 changed files with 7 additions and 12 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-org': patch
---
Make ownership card style customizable via custom `theme.getPageTheme()`.
@@ -29,7 +29,7 @@ import {
isOwnerOf,
useEntity,
} from '@backstage/plugin-catalog-react';
import { BackstageTheme, genPageTheme } from '@backstage/theme';
import { BackstageTheme } from '@backstage/theme';
import {
Box,
createStyles,
@@ -49,16 +49,6 @@ type EntityTypeProps = {
count: number;
};
const createPageTheme = (
theme: BackstageTheme,
shapeKey: string,
colorsKey: string,
) => {
const { colors } = theme.getPageTheme({ themeId: colorsKey });
const { shape } = theme.getPageTheme({ themeId: shapeKey });
return genPageTheme(colors, shape).backgroundImage;
};
const useStyles = makeStyles((theme: BackstageTheme) =>
createStyles({
card: {
@@ -77,7 +67,7 @@ const useStyles = makeStyles((theme: BackstageTheme) =>
},
entityTypeBox: {
background: (props: { type: string }) =>
createPageTheme(theme, props.type, props.type),
theme.getPageTheme({ themeId: props.type }).backgroundImage,
},
}),
);