Last change
on this file since 0ad69c1 was 3a58bd6, checked in by Viktor <39170279+Tasevski2@…>, 3 years ago |
Added Frontend
|
-
Property mode
set to
100644
|
File size:
776 bytes
|
Rev | Line | |
---|
[3a58bd6] | 1 | import Snackbar from '@mui/material/Snackbar';
|
---|
| 2 | import MuiAlert from '@mui/material/Alert';
|
---|
| 3 | import Slide from '@mui/material/Slide'
|
---|
| 4 |
|
---|
| 5 | const SlideTransition = props => (
|
---|
| 6 | <Slide {...props} direction="down" />
|
---|
| 7 | );
|
---|
| 8 |
|
---|
| 9 | const 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 |
|
---|
| 31 | export default Alert; |
---|
Note:
See
TracBrowser
for help on using the repository browser.