Make ownership card style customizable via custom theme.getPageTheme()
Signed-off-by: Oliver Sand <oliver.sand@sda-se.com>
This commit is contained in:
@@ -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,
|
||||
},
|
||||
}),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user