You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2021/07/09 16:42:45 UTC

[GitHub] [superset] michael-s-molina commented on a change in pull request #15579: refactor: icon to icons for toasts component

michael-s-molina commented on a change in pull request #15579:
URL: https://github.com/apache/superset/pull/15579#discussion_r667080797



##########
File path: superset-frontend/src/messageToasts/components/Toast.tsx
##########
@@ -76,16 +77,17 @@ export default function Toast({ toast, onCloseToast }: ToastPresenterProps) {
     };
   }, [handleClosePress, toast.duration]);
 
-  let iconName: IconName = 'circle-check-solid';
   let className = 'toast--success';
+  let icon = <Icons.CircleCheckSolid css={theme => StyledIcon(theme)} />;
+
   if (toast.toastType === ToastType.WARNING) {
-    iconName = 'warning-solid';
+    icon = <Icons.WarningSolid css={StyledIcon} />;
     className = 'toast--warning';
   } else if (toast.toastType === ToastType.DANGER) {
-    iconName = 'error-solid';
+    icon = <Icons.ErrorSolid css={theme => StyledIcon(theme)} />;

Review comment:
       ```suggestion
       icon = <Icons.ErrorSolid css={StyledIcon} />;
   ```

##########
File path: superset-frontend/src/messageToasts/components/Toast.tsx
##########
@@ -76,16 +77,17 @@ export default function Toast({ toast, onCloseToast }: ToastPresenterProps) {
     };
   }, [handleClosePress, toast.duration]);
 
-  let iconName: IconName = 'circle-check-solid';
   let className = 'toast--success';
+  let icon = <Icons.CircleCheckSolid css={theme => StyledIcon(theme)} />;
+
   if (toast.toastType === ToastType.WARNING) {
-    iconName = 'warning-solid';
+    icon = <Icons.WarningSolid css={StyledIcon} />;
     className = 'toast--warning';
   } else if (toast.toastType === ToastType.DANGER) {
-    iconName = 'error-solid';
+    icon = <Icons.ErrorSolid css={theme => StyledIcon(theme)} />;
     className = 'toast--danger';
   } else if (toast.toastType === ToastType.INFO) {
-    iconName = 'info-solid';
+    icon = <Icons.InfoSolid css={theme => StyledIcon(theme)} />;

Review comment:
       ```suggestion
       icon = <Icons.InfoSolid css={StyledIcon} />;
   ```




-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org