source: sources/client/src/components/Alert/index.js@ bc20307

Last change on this file since bc20307 was 3a58bd6, checked in by Viktor <39170279+Tasevski2@…>, 3 years ago

Added Frontend

  • Property mode set to 100644
File size: 776 bytes
Line 
1import Snackbar from '@mui/material/Snackbar';
2import MuiAlert from '@mui/material/Alert';
3import Slide from '@mui/material/Slide'
4
5const SlideTransition = props => (
6 <Slide {...props} direction="down" />
7);
8
9const Alert = ({ isOpen, setIsOpen, type, msg }) => {
10 return <Snackbar
11 open={isOpen}
12 autoHideDuration={2000}
13 onClose={() => setIsOpen(false)}
14 anchorOrigin={{
15 vertical: 'top',
16 horizontal: 'center'
17 }}
18 TransitionComponent={SlideTransition}
19 >
20 <MuiAlert
21 onClose={() => setIsOpen(false)}
22 severity={type}
23 sx={{ width: '100%' }}
24 variant="filled"
25 >
26 {msg}
27 </MuiAlert>
28 </Snackbar>
29};
30
31export default Alert;
Note: See TracBrowser for help on using the repository browser.