packages/theme: make BackstageTheme a type and update usages
This commit is contained in:
@@ -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 (
|
||||
|
||||
Reference in New Issue
Block a user