Fix alerts overflow and improve message-bubble style

This commit is contained in:
J Francisco Rader committed 2021-02-21 13:03:19 -05:00
1 parent 9f04ac3243
commit bf7d94b33d
2 files changed
+32 -6

No files matched your search

+24 -2
View File
@@ -1,8 +1,30 @@
import React from 'react';
import MuiAlert from '@material-ui/lab/Alert';
import { makeStyles, Typography } from '@material-ui/core';
export function Alert(props) {
return <MuiAlert style={{ zIndex: 10000 }} elevation={6} variant='filled' {...props} />;
const useStyles = makeStyles({
root: {
zIndex: 10000,
},
msg: {
maxWidth: '300px',
wordWrap: 'break-word',
fontSize: '1em'
},
});
export function Alert({ children, ...props }) {
const classes = useStyles();
return (
<MuiAlert
className={classes.root}
elevation={6}
variant='filled'
{...props}
>
<Typography className={classes.msg}>{children}</Typography>
</MuiAlert>
);
}
export default Alert;