From e176e145c7f72788a724f2a7ab217c0918ad7c3b Mon Sep 17 00:00:00 2001 From: tonyvugithub <55034244+tonyvugithub@users.noreply.github.com> Date: Sun, 17 Jan 2021 20:13:33 -0500 Subject: [PATCH] Ported SnackBar component --- src/frontend/next/package.json | 1 + .../next/src/components/SnackBar/SnackBar.tsx | 39 +++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 src/frontend/next/src/components/SnackBar/SnackBar.tsx diff --git a/src/frontend/next/package.json b/src/frontend/next/package.json index fad513b151..fca76fe5cb 100644 --- a/src/frontend/next/package.json +++ b/src/frontend/next/package.json @@ -9,6 +9,7 @@ }, "dependencies": { "@material-ui/core": "^4.11.2", + "@material-ui/icons": "^4.11.2", "next": "^10.0.2", "react": "^16.13.1", "react-dom": "^16.13.1" diff --git a/src/frontend/next/src/components/SnackBar/SnackBar.tsx b/src/frontend/next/src/components/SnackBar/SnackBar.tsx new file mode 100644 index 0000000000..a145cc050d --- /dev/null +++ b/src/frontend/next/src/components/SnackBar/SnackBar.tsx @@ -0,0 +1,39 @@ +import { useState } from 'react'; +import Snackbar from '@material-ui/core/Snackbar'; +import IconButton from '@material-ui/core/IconButton'; +import CloseIcon from '@material-ui/icons/Close'; + +type SnackbarProps = { + message: string; +}; + +const SimpleSnackbar = ({ message }: SnackbarProps) => { + const [open, setOpen] = useState(true); + + const handleClose = () => { + setOpen(false); + }; + + return ( +
+ + + + + + } + /> +
+ ); +}; + +export default SimpleSnackbar;