optmized lines
This commit is contained in:
@@ -18,24 +18,27 @@ export default class ChatMessageView extends Component {
|
|||||||
const formattedTimestamp = formatTimestamp(timestamp);
|
const formattedTimestamp = formatTimestamp(timestamp);
|
||||||
|
|
||||||
const isSystemMessage = message.type === SOCKET_MESSAGE_TYPES.SYSTEM;
|
const isSystemMessage = message.type === SOCKET_MESSAGE_TYPES.SYSTEM;
|
||||||
const authorColor = textColorForString(author);
|
|
||||||
const backgroundColor = messageBubbleColorForString(author);
|
const authorTextColor = isSystemMessage
|
||||||
const authorTextColor = isSystemMessage ? { color: 'white' } : { color: authorColor };
|
? { color: '#fff' }
|
||||||
|
: { color: textColorForString(author) };
|
||||||
const backgroundStyle = isSystemMessage
|
const backgroundStyle = isSystemMessage
|
||||||
? { backgroundColor: '#667eea' }
|
? { backgroundColor: '#667eea' }
|
||||||
: { backgroundColor: backgroundColor };
|
: { backgroundColor: messageBubbleColorForString(author) };
|
||||||
const classString = isSystemMessage ? getSystemMessageClassString() : getChatMessageClassString();
|
const messageClassString = isSystemMessage
|
||||||
|
? getSystemMessageClassString()
|
||||||
|
: getChatMessageClassString();
|
||||||
|
|
||||||
return html`
|
return html`
|
||||||
<div
|
<div
|
||||||
style=${backgroundStyle}
|
style=${backgroundStyle}
|
||||||
class=${classString}
|
class=${messageClassString}
|
||||||
title=${formattedTimestamp}
|
title=${formattedTimestamp}
|
||||||
>
|
>
|
||||||
<div class="message-content break-words w-full">
|
<div class="message-content break-words w-full">
|
||||||
<div
|
<div
|
||||||
style=${authorTextColor}
|
style=${authorTextColor}
|
||||||
class="message-author text-white font-bold"
|
class="message-author font-bold"
|
||||||
>
|
>
|
||||||
${author}
|
${author}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user