mirror of
https://github.com/owncast/owncast.git
synced 2024-10-24 21:45:59 +03:00
Use user color for name change messages
This commit is contained in:
parent
23e3751303
commit
5e4334ac01
1 changed files with 9 additions and 6 deletions
|
@ -7,7 +7,6 @@ import { MessageType, NameChangeEvent } from '../../../interfaces/socket-events'
|
|||
import s from './ChatContainer.module.scss';
|
||||
import { ChatMessage } from '../../../interfaces/chat-message.model';
|
||||
import { ChatUserMessage } from '..';
|
||||
import ChatActionMessage from '../ChatActionMessage';
|
||||
|
||||
interface Props {
|
||||
messages: ChatMessage[];
|
||||
|
@ -24,11 +23,15 @@ export default function ChatContainer(props: Props) {
|
|||
const spinIcon = <LoadingOutlined style={{ fontSize: '32px' }} spin />;
|
||||
|
||||
const getNameChangeViewForMessage = (message: NameChangeEvent) => {
|
||||
const { oldName } = message;
|
||||
const { user } = message;
|
||||
const { displayName } = user;
|
||||
const body = `<strong>${oldName}</strong> is now known as <strong>${displayName}</strong>`;
|
||||
return <ChatActionMessage body={body} />;
|
||||
const { oldName, user } = message;
|
||||
const { displayName, displayColor } = user;
|
||||
const color = `var(--theme-user-colors-${displayColor})`;
|
||||
|
||||
return (
|
||||
<div>
|
||||
<span style={{ color }}>{oldName}</span> is now known as {displayName}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
const getViewForMessage = message => {
|
||||
|
|
Loading…
Reference in a new issue