mistercrunch commented on code in PR #31858:
URL: https://github.com/apache/superset/pull/31858#discussion_r1926073445
##########
superset-frontend/src/components/Alert/index.tsx:
##########
@@ -32,59 +30,17 @@ export default function Alert(props: AlertProps) {
description,
showIcon = true,
closable = true,
- roomBelow = false,
children,
} = props;
- const theme = useTheme();
- const { colors } = theme;
- const { alert: alertColor, error, info, success } = colors;
-
- let baseColor = info;
- let AlertIcon = Icons.InfoSolid;
- if (type === 'error') {
- baseColor = error;
- AlertIcon = Icons.ErrorSolid;
- } else if (type === 'warning') {
- baseColor = alertColor;
- AlertIcon = Icons.AlertSolid;
- } else if (type === 'success') {
- baseColor = success;
- AlertIcon = Icons.CircleCheckSolid;
- }
-
return (
<AntdAlert
role="alert"
aria-live={type === 'error' ? 'assertive' : 'polite'}
showIcon={showIcon}
- icon={
- showIcon && (
- <span
- role="img"
- aria-label={`${type} icon`}
- style={{
- color: baseColor.base,
- }}
- >
- <AlertIcon />
- </span>
- )
- }
- closeIcon={closable && <Icons.XSmall aria-label="close icon" />}
+ closeIcon={closable}
Review Comment:
oops, also noting we should be destructing into `...rest` here
--
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]