chore: removing use of supersetTheme in favor of ThemeProvider (#17000)

This commit is contained in:
Evan Rusackas
2021-10-07 01:36:57 -06:00
committed by GitHub
parent cde4cdcd0c
commit 66fbce9dec
2 changed files with 12 additions and 8 deletions

View File

@@ -17,7 +17,7 @@
* under the License.
*/
import React from 'react';
import { styled, supersetTheme } from '@superset-ui/core';
import { styled, useTheme } from '@superset-ui/core';
import Icons from 'src/components/Icons';
import { ErrorLevel } from './types';
@@ -54,12 +54,14 @@ export default function BasicErrorAlert({
level,
title,
}: BasicErrorAlertProps) {
const theme = useTheme();
return (
<StyledContainer level={level} role="alert">
{level === 'error' ? (
<Icons.ErrorSolid iconColor={supersetTheme.colors[level].base} />
<Icons.ErrorSolid iconColor={theme.colors[level].base} />
) : (
<Icons.WarningSolid iconColor={supersetTheme.colors[level].base} />
<Icons.WarningSolid iconColor={theme.colors[level].base} />
)}
<StyledContent>
<StyledTitle>{title}</StyledTitle>