villebro commented on a change in pull request #17027:
URL: https://github.com/apache/superset/pull/17027#discussion_r725828952
##########
File path: superset-frontend/src/components/ErrorMessage/ErrorAlert.tsx
##########
@@ -108,10 +108,10 @@ export default function ErrorAlert({
<ErrorAlertDiv level={level} role="alert">
<div className="top-row">
<LeftSideContent>
- {!level || level === 'error' ? (
+ {level === 'error' ? (
<Icons.ErrorSolid
className="icon"
- iconColor={theme.colors.error.base}
+ iconColor={theme.colors[level].base}
Review comment:
Same here
##########
File path: superset-frontend/src/components/ErrorMessage/BasicErrorAlert.tsx
##########
@@ -51,15 +51,15 @@ interface BasicErrorAlertProps {
export default function BasicErrorAlert({
body,
- level,
+ level = 'error',
title,
}: BasicErrorAlertProps) {
const theme = useTheme();
return (
<StyledContainer level={level} role="alert">
- {!level || level === 'error' ? (
- <Icons.ErrorSolid iconColor={theme.colors.error.base} />
+ {level === 'error' ? (
+ <Icons.ErrorSolid iconColor={theme.colors[level].base} />
Review comment:
To avoid duplication, could we create `const iconColor =
theme.colors[level].base` above and then reference that here and below?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]