Make chat lines slightly prettier

This commit is contained in:
Franck Royer 2021-04-27 14:26:52 +10:00
parent 14ccfdf2dd
commit 973fd95df9
No known key found for this signature in database
GPG Key ID: A82ED75A8DFC50A4
1 changed files with 32 additions and 4 deletions

View File

@ -1,4 +1,11 @@
import { List, ListItem, ListItemText } from '@material-ui/core';
import {
Card,
CardContent,
List,
ListItem,
ListItemText,
Typography,
} from '@material-ui/core';
import React from 'react';
import { ChatMessage } from '../../build/main/chat/chat_message';
@ -31,9 +38,30 @@ function Message(props: MessageProps) {
minute: '2-digit',
hour12: false,
});
// {`<${timestamp}> ${chatMsg.nick}: ${chatMsg.message}`}
return (
<div className="chat-message">
{`<${timestamp}> ${chatMsg.nick}: ${chatMsg.message}`}
</div>
<Card className="chat-message" variant="outlined">
<CardContent>
<Typography className="chat-nick" variant="subtitle2">
{chatMsg.nick}
<Typography
className="chat-timestamp"
color="textSecondary"
variant="caption"
style={{ marginLeft: 3 }}
>
{timestamp}
</Typography>
</Typography>
<Typography
className="chat-message-content"
variant="body1"
component="p"
>
{chatMsg.message}
</Typography>
</CardContent>
</Card>
);
}