feat: improve message display

This commit is contained in:
Jeremy Kahn 2022-08-28 11:45:26 -05:00
parent 707e090f8b
commit a6a5c90a73

View File

@ -50,24 +50,26 @@ export const Message = ({ message, userId }: MessageProps) => {
return (
<Box className="Message">
<Typography
variant="overline"
variant="caption"
display="block"
color="grey.400"
sx={{
textAlign: message.authorId === userId ? 'right' : 'left',
}}
>
{userId}
{message.authorId}
</Typography>
<Box
sx={{
backgroundColor,
margin: 0.5,
padding: 1,
padding: '0.5em 0.75em',
borderRadius: 6,
float: message.authorId === userId ? 'right' : 'left',
transition: 'background-color 1s',
wordBreak: 'break-all',
wordBreak: 'break-word',
}}
maxWidth="85%"
>
<Markdown components={componentMap} linkTarget="_blank">
{message.text}