Merge pull request #16713 from Pike/theming-scaffolder
Use page theme fontColor consistently in scaffolder headers and cards.
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
|
||||
import { useRouteRef } from '@backstage/core-plugin-api';
|
||||
import { BackstageTheme } from '@backstage/theme';
|
||||
import IconButton from '@material-ui/core/IconButton';
|
||||
import ListItemIcon from '@material-ui/core/ListItemIcon';
|
||||
import ListItemText from '@material-ui/core/ListItemText';
|
||||
@@ -34,9 +35,9 @@ import {
|
||||
scaffolderListTaskRouteRef,
|
||||
} from '../../routes';
|
||||
|
||||
const useStyles = makeStyles(theme => ({
|
||||
const useStyles = makeStyles<BackstageTheme>(theme => ({
|
||||
button: {
|
||||
color: theme.palette.common.white,
|
||||
color: theme.page.fontColor,
|
||||
},
|
||||
}));
|
||||
|
||||
|
||||
@@ -64,12 +64,16 @@ import WarningIcon from '@material-ui/icons/Warning';
|
||||
import React from 'react';
|
||||
import { selectedTemplateRouteRef, viewTechDocRouteRef } from '../../routes';
|
||||
|
||||
const useStyles = makeStyles(theme => ({
|
||||
const useStyles = makeStyles<
|
||||
BackstageTheme,
|
||||
{ fontColor: string; backgroundImage: string }
|
||||
>(theme => ({
|
||||
cardHeader: {
|
||||
position: 'relative',
|
||||
},
|
||||
title: {
|
||||
backgroundImage: ({ backgroundImage }: any) => backgroundImage,
|
||||
backgroundImage: ({ backgroundImage }) => backgroundImage,
|
||||
color: ({ fontColor }) => fontColor,
|
||||
},
|
||||
box: {
|
||||
overflow: 'hidden',
|
||||
@@ -186,7 +190,10 @@ export const TemplateCard = ({ template, deprecated }: TemplateCardProps) => {
|
||||
? templateProps.type
|
||||
: 'other';
|
||||
const theme = backstageTheme.getPageTheme({ themeId });
|
||||
const classes = useStyles({ backgroundImage: theme.backgroundImage });
|
||||
const classes = useStyles({
|
||||
fontColor: theme.fontColor,
|
||||
backgroundImage: theme.backgroundImage,
|
||||
});
|
||||
const { name, namespace } = parseEntityRef(stringifyEntityRef(template));
|
||||
const href = templateRoute({ templateName: name, namespace });
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
|
||||
import { useRouteRef } from '@backstage/core-plugin-api';
|
||||
import { BackstageTheme } from '@backstage/theme';
|
||||
import IconButton from '@material-ui/core/IconButton';
|
||||
import ListItemIcon from '@material-ui/core/ListItemIcon';
|
||||
import ListItemText from '@material-ui/core/ListItemText';
|
||||
@@ -34,9 +35,9 @@ import {
|
||||
nextScaffolderListTaskRouteRef,
|
||||
} from '../routes';
|
||||
|
||||
const useStyles = makeStyles(theme => ({
|
||||
const useStyles = makeStyles((theme: BackstageTheme) => ({
|
||||
button: {
|
||||
color: theme.palette.common.white,
|
||||
color: theme.page.fontColor,
|
||||
},
|
||||
}));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user