From ece3514cb3945d823fd15b16184054ba95c2a1d1 Mon Sep 17 00:00:00 2001 From: Delucse <46593742+Delucse@users.noreply.github.com> Date: Mon, 21 Sep 2020 11:40:33 +0200 Subject: [PATCH] initialize snackbar --- src/components/Snackbar.js | 50 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 src/components/Snackbar.js diff --git a/src/components/Snackbar.js b/src/components/Snackbar.js new file mode 100644 index 0000000..e3763d1 --- /dev/null +++ b/src/components/Snackbar.js @@ -0,0 +1,50 @@ +import React, { Component } from 'react'; + +import { withStyles } from '@material-ui/core/styles'; +import IconButton from '@material-ui/core/IconButton'; +import MaterialUISnackbar from '@material-ui/core/Snackbar'; +import SnackbarContent from '@material-ui/core/SnackbarContent'; + +import { faTimes } from "@fortawesome/free-solid-svg-icons"; +import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; + +const styles = (theme) => ({ + success: { + backgroundColor: theme.palette.primary.main, + color: theme.palette.primary.contrastText + }, + error: { + backgroundColor: theme.palette.error.dark, + color: theme.palette.error.contrastText + } +}); + +class Snackbar extends Component { + + render() { + return ( + + + + + } + message={this.props.message} + /> + + ); + }; +} + + +export default withStyles(styles, {withTheme: true})(Snackbar);