fix: error alert levels again (#17027)

This commit is contained in:
Erik Ritter
2021-10-11 12:28:36 -07:00
committed by GitHub
parent 83a783de58
commit 153469dba9
2 changed files with 13 additions and 23 deletions

View File

@@ -51,17 +51,18 @@ interface BasicErrorAlertProps {
export default function BasicErrorAlert({
body,
level,
level = 'error',
title,
}: BasicErrorAlertProps) {
const theme = useTheme();
const iconColor = theme.colors[level].base;
return (
<StyledContainer level={level} role="alert">
{!level || level === 'error' ? (
<Icons.ErrorSolid iconColor={theme.colors.error.base} />
{level === 'error' ? (
<Icons.ErrorSolid iconColor={iconColor} />
) : (
<Icons.WarningSolid iconColor={theme.colors[level].base} />
<Icons.WarningSolid iconColor={iconColor} />
)}
<StyledContent>
<StyledTitle>{title}</StyledTitle>