X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/afa04ca15bcaa890770a30ddb099b62f5cbe2926..e51530db62c369733186003cc5f005e491f29373:/src/views-components/snackbar/snackbar.tsx

diff --git a/src/views-components/snackbar/snackbar.tsx b/src/views-components/snackbar/snackbar.tsx
index 59dddcaf..03fe57e4 100644
--- a/src/views-components/snackbar/snackbar.tsx
+++ b/src/views-components/snackbar/snackbar.tsx
@@ -83,46 +83,47 @@ const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
     },
 });
 
-const ArvadosSnackbar = (props: SnackbarDataProps & SnackbarEventProps & WithStyles<CssRules>) => {
-    const { classes } = props;
+export const Snackbar = withStyles(styles)(connect(mapStateToProps, mapDispatchToProps)(
+    (props: SnackbarDataProps & SnackbarEventProps & WithStyles<CssRules>) => {
+        const { classes } = props;
 
-    const variants = {
-        [SnackbarKind.INFO]: [InfoIcon, classes.info],
-        [SnackbarKind.WARNING]: [WarningIcon, classes.warning],
-        [SnackbarKind.SUCCESS]: [CheckCircleIcon, classes.success],
-        [SnackbarKind.ERROR]: [ErrorIcon, classes.error]
-    };
-
-    const [Icon, cssClass] = variants[props.kind];
+        const variants = {
+            [SnackbarKind.INFO]: [InfoIcon, classes.info],
+            [SnackbarKind.WARNING]: [WarningIcon, classes.warning],
+            [SnackbarKind.SUCCESS]: [CheckCircleIcon, classes.success],
+            [SnackbarKind.ERROR]: [ErrorIcon, classes.error]
+        };
 
-    return (
-        <MaterialSnackbar
-            open={props.open}
-            message={props.message}
-            onClose={props.onClose}
-            anchorOrigin={props.anchorOrigin}
-            autoHideDuration={props.autoHideDuration}>
-            <SnackbarContent
-                className={classNames(cssClass)}
-                aria-describedby="client-snackbar"
-                message={
-                    <span id="client-snackbar" className={classes.message}>
-                        <Icon className={classNames(classes.icon, classes.iconVariant)}/>
-                        {props.message}
-                    </span>
-                }
-                action={
-                    <IconButton
-                        key="close"
-                        aria-label="Close"
-                        color="inherit"
-                        onClick={e => props.onClose && props.onClose(e, '')}>
-                        <CloseIcon className={classes.icon}/>
-                    </IconButton>
-                }
-            />
-        </MaterialSnackbar>
-    );
-};
+        const [Icon, cssClass] = variants[props.kind];
 
-export const Snackbar = withStyles(styles)(connect(mapStateToProps, mapDispatchToProps)(ArvadosSnackbar));
+        return (
+            <MaterialSnackbar
+                open={props.open}
+                message={props.message}
+                onClose={props.onClose}
+                onExited={props.onExited}
+                anchorOrigin={props.anchorOrigin}
+                autoHideDuration={props.autoHideDuration}>
+                <SnackbarContent
+                    className={classNames(cssClass)}
+                    aria-describedby="client-snackbar"
+                    message={
+                        <span id="client-snackbar" className={classes.message}>
+                            <Icon className={classNames(classes.icon, classes.iconVariant)}/>
+                            {props.message}
+                        </span>
+                    }
+                    action={
+                        <IconButton
+                            key="close"
+                            aria-label="Close"
+                            color="inherit"
+                            onClick={e => props.onClose && props.onClose(e, '')}>
+                            <CloseIcon className={classes.icon}/>
+                        </IconButton>
+                    }
+                />
+            </MaterialSnackbar>
+        );
+    }
+));
