mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 22:16:40 +00:00
Fix alerts overflow and improve message-bubble style
This commit is contained in:
2 files changed
+32
-6
No files matched your search
@@ -12,9 +12,11 @@ const useStyles = makeStyles((theme) => ({
|
|||||||
mySms: {
|
mySms: {
|
||||||
float: 'right',
|
float: 'right',
|
||||||
margin: theme.spacing(1),
|
margin: theme.spacing(1),
|
||||||
padding: '6px 12px',
|
padding: '6px 16px',
|
||||||
height: 'auto',
|
height: 'auto',
|
||||||
width: '80%',
|
width: 'auto',
|
||||||
|
minWidth: '60%',
|
||||||
|
maxWidth: '85%',
|
||||||
background: theme.palette.background.default,
|
background: theme.palette.background.default,
|
||||||
color: theme.palette.text.primary,
|
color: theme.palette.text.primary,
|
||||||
borderRadius: '20px',
|
borderRadius: '20px',
|
||||||
@@ -24,7 +26,9 @@ const useStyles = makeStyles((theme) => ({
|
|||||||
float: 'left',
|
float: 'left',
|
||||||
margin: theme.spacing(1),
|
margin: theme.spacing(1),
|
||||||
padding: '6px 12px',
|
padding: '6px 12px',
|
||||||
width: '80%',
|
width: 'auto',
|
||||||
|
minWidth: '60%',
|
||||||
|
maxWidth: '85%',
|
||||||
height: 'auto',
|
height: 'auto',
|
||||||
background: theme.palette.primary.light,
|
background: theme.palette.primary.light,
|
||||||
color: theme.palette.getContrastText(theme.palette.primary.light),
|
color: theme.palette.getContrastText(theme.palette.primary.light),
|
||||||
@@ -62,7 +66,7 @@ export const MessageBubble = ({
|
|||||||
<div>{message.message}</div>
|
<div>{message.message}</div>
|
||||||
)}
|
)}
|
||||||
</Box>
|
</Box>
|
||||||
<Box textAlign='right'>
|
<Box>
|
||||||
<Typography variant='subtitle1' color='secondary'>
|
<Typography variant='subtitle1' color='secondary'>
|
||||||
{isGroupChat && !message.isMine
|
{isGroupChat && !message.isMine
|
||||||
? message.display || message.phone_number
|
? message.display || message.phone_number
|
||||||
|
|||||||
@@ -1,8 +1,30 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import MuiAlert from '@material-ui/lab/Alert';
|
import MuiAlert from '@material-ui/lab/Alert';
|
||||||
|
import { makeStyles, Typography } from '@material-ui/core';
|
||||||
|
|
||||||
export function Alert(props) {
|
const useStyles = makeStyles({
|
||||||
return <MuiAlert style={{ zIndex: 10000 }} elevation={6} variant='filled' {...props} />;
|
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;
|
export default Alert;
|
||||||
Reference in new issue
Block a user