forked from Shiloh/remnantchat
feat: improve message display
This commit is contained in:
parent
707e090f8b
commit
a6a5c90a73
@ -50,24 +50,26 @@ export const Message = ({ message, userId }: MessageProps) => {
|
|||||||
return (
|
return (
|
||||||
<Box className="Message">
|
<Box className="Message">
|
||||||
<Typography
|
<Typography
|
||||||
variant="overline"
|
variant="caption"
|
||||||
display="block"
|
display="block"
|
||||||
|
color="grey.400"
|
||||||
sx={{
|
sx={{
|
||||||
textAlign: message.authorId === userId ? 'right' : 'left',
|
textAlign: message.authorId === userId ? 'right' : 'left',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{userId}
|
{message.authorId}
|
||||||
</Typography>
|
</Typography>
|
||||||
<Box
|
<Box
|
||||||
sx={{
|
sx={{
|
||||||
backgroundColor,
|
backgroundColor,
|
||||||
margin: 0.5,
|
margin: 0.5,
|
||||||
padding: 1,
|
padding: '0.5em 0.75em',
|
||||||
borderRadius: 6,
|
borderRadius: 6,
|
||||||
float: message.authorId === userId ? 'right' : 'left',
|
float: message.authorId === userId ? 'right' : 'left',
|
||||||
transition: 'background-color 1s',
|
transition: 'background-color 1s',
|
||||||
wordBreak: 'break-all',
|
wordBreak: 'break-word',
|
||||||
}}
|
}}
|
||||||
|
maxWidth="85%"
|
||||||
>
|
>
|
||||||
<Markdown components={componentMap} linkTarget="_blank">
|
<Markdown components={componentMap} linkTarget="_blank">
|
||||||
{message.text}
|
{message.text}
|
||||||
|
Loading…
Reference in New Issue
Block a user