-
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add snackbar component and wiring for model loading
- Loading branch information
Oleg
committed
Oct 28, 2021
1 parent
05e51ac
commit 0ddbaf2
Showing
4 changed files
with
51 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import React from 'react'; | ||
import Snackbar from '@mui/material/Snackbar'; | ||
import { makeStyles } from '@material-ui/core/styles'; | ||
import MuiAlert from '@mui/material/Alert'; | ||
|
||
const Alert = React.forwardRef(function Alert(props, ref) { | ||
return <MuiAlert elevation={1} ref={ref} variant='filled' {...props} />; | ||
}); | ||
|
||
const useStyles = makeStyles((theme) => ({ | ||
alert: { | ||
backgroundColor: '#787878', | ||
width: 'auto', | ||
paddingRight: 20, | ||
}, | ||
})); | ||
|
||
const SnackBarMessage = ({ message, type, open }) => { | ||
const classes = useStyles(); | ||
return ( | ||
<Snackbar | ||
open={open} | ||
anchorOrigin={{ vertical: 'bottom', horizontal: 'right' }} | ||
autoHideDuration={6000} | ||
> | ||
<Alert | ||
style={{ | ||
backgroundColor: '#787878', | ||
width: 'auto', | ||
paddingRight: 20, | ||
}} | ||
severity={type} | ||
> | ||
{message} | ||
</Alert> | ||
</Snackbar> | ||
); | ||
}; | ||
|
||
export default SnackBarMessage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters