diff options
Diffstat (limited to 'web/src/components/NotificationBar.tsx')
| -rw-r--r-- | web/src/components/NotificationBar.tsx | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/web/src/components/NotificationBar.tsx b/web/src/components/NotificationBar.tsx index 119692665..f4202bf4e 100644 --- a/web/src/components/NotificationBar.tsx +++ b/web/src/components/NotificationBar.tsx @@ -1,8 +1,10 @@ import React, { useState, useEffect } from "react"; + import { Snackbar } from "@material-ui/core"; -import ColoredSnackbarContent from "./ColoredSnackbarContent"; + import { useNotifications } from "../hooks/NotificationsContext"; import { Notification } from "../models/Notifications"; +import ColoredSnackbarContent from "./ColoredSnackbarContent"; export interface Props { onClose: () => void; @@ -26,13 +28,15 @@ const NotificationBar = function (props: Props) { anchorOrigin={{ vertical: "top", horizontal: "right" }} autoHideDuration={tmpNotification ? tmpNotification.timeout * 1000 : 10000} onClose={props.onClose} - onExited={() => setTmpNotification(null)}> + onExited={() => setTmpNotification(null)} + > <ColoredSnackbarContent className="notification" level={tmpNotification ? tmpNotification.level : "info"} - message={tmpNotification ? tmpNotification.message : ""} /> + message={tmpNotification ? tmpNotification.message : ""} + /> </Snackbar> - ) -} + ); +}; -export default NotificationBar
\ No newline at end of file +export default NotificationBar; |
