Use page theme fontColor in scaffolder, episode 2

I missed some white fonts in #16713

Signed-off-by: Axel Hecht <axel@pike.org>
This commit is contained in:
Axel Hecht
2023-04-04 19:58:50 +02:00
parent 1a3b00a8b4
commit 7917cfccfc
3 changed files with 12 additions and 5 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-scaffolder': patch
---
Fix some hard-coded white font colors in scaffolder
@@ -107,7 +107,7 @@ const useStyles = makeStyles<
top: theme.spacing(0.5),
right: theme.spacing(0.5),
padding: '0.25rem',
color: theme.palette.common.white,
color: ({ fontColor }) => fontColor,
},
}));
@@ -22,6 +22,7 @@ import {
MenuItem,
MenuList,
Popover,
useTheme,
} from '@material-ui/core';
import { useAsync } from '@react-hookz/web';
import Cancel from '@material-ui/icons/Cancel';
@@ -40,16 +41,18 @@ type ContextMenuProps = {
taskId?: string;
};
const useStyles = makeStyles((theme: BackstageTheme) => ({
const useStyles = makeStyles<BackstageTheme, { fontColor: string }>(() => ({
button: {
color: theme.palette.common.white,
color: ({ fontColor }) => fontColor,
},
}));
export const ContextMenu = (props: ContextMenuProps) => {
const { cancelEnabled, logsVisible, onStartOver, onToggleLogs, taskId } =
props;
const classes = useStyles();
const { getPageTheme } = useTheme<BackstageTheme>();
const pageTheme = getPageTheme({ themeId: 'website' });
const classes = useStyles({ fontColor: pageTheme.fontColor });
const scaffolderApi = useApi(scaffolderApiRef);
const [anchorEl, setAnchorEl] = useState<HTMLButtonElement>();
@@ -69,7 +72,6 @@ export const ContextMenu = (props: ContextMenuProps) => {
setAnchorEl(event.currentTarget);
}}
data-testid="menu-button"
color="inherit"
className={classes.button}
>
<MoreVert />