packages/theme: make BackstageTheme a type and update usages

This commit is contained in:
Patrik Oldsberg
2020-04-16 01:34:53 +02:00
parent d766d7aac4
commit d9f34e3fff
7 changed files with 8 additions and 14 deletions
@@ -18,10 +18,7 @@ import { Sparklines, SparklinesLine, SparklinesProps } from 'react-sparklines';
import { useTheme } from '@material-ui/core';
import { BackstageTheme } from '@backstage/theme';
function color(
data: number[],
theme: typeof BackstageTheme,
): string | undefined {
function color(data: number[], theme: BackstageTheme): string | undefined {
const lastNum = data[data.length - 1];
if (!lastNum) return undefined;
if (lastNum >= 0.9) return theme.palette.status.ok;
@@ -30,7 +27,7 @@ function color(
}
const CategoryTrendline: FC<SparklinesProps & { title?: string }> = props => {
const theme = useTheme<typeof BackstageTheme>();
const theme = useTheme<BackstageTheme>();
if (!props.data) return null;
return (