mirror of
https://github.com/duckietm/Nitro-Cool-UI.git
synced 2025-06-21 22:36:58 +00:00
other small fix
This commit is contained in:
parent
e4db70d3ba
commit
7cf47fac1c
@ -116,15 +116,6 @@ allowedColours.set('saddlebrown', 'saddlebrown');
|
||||
allowedColours.set('sienna', 'sienna');
|
||||
allowedColours.set('brown', 'brown');
|
||||
|
||||
export const sanitizeColor = (color: string | null | undefined): string | null => {
|
||||
if (!color) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const sanitizedColor = allowedColours.get(color.toLowerCase());
|
||||
return sanitizedColor || null;
|
||||
};
|
||||
|
||||
const encodeHTML = (str: string) =>
|
||||
{
|
||||
return str.replace(/([\u00A0-\u9999<>&])(.|$)/g, (full, char, next) =>
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { RoomChatSettings, RoomObjectCategory } from '@nitrots/nitro-renderer';
|
||||
import { FC, useEffect, useMemo, useRef, useState } from 'react';
|
||||
import { ChatBubbleMessage, sanitizeColor, GetRoomEngine } from '../../../../api';
|
||||
import { ChatBubbleMessage, GetRoomEngine } from '../../../../api';
|
||||
import { useOnClickChat } from '../../../../hooks';
|
||||
|
||||
interface ChatWidgetMessageViewProps
|
||||
@ -89,7 +89,7 @@ export const ChatWidgetMessageView: FC<ChatWidgetMessageViewProps> = props => {
|
||||
</div>
|
||||
<div className="chat-content">
|
||||
<b className="username mr-1" dangerouslySetInnerHTML={ { __html: `${ chat.username }: ` } } />
|
||||
<span className="message" style={{ color: sanitizeColor(chat.chatColours) }} dangerouslySetInnerHTML={{ __html: `${chat.formattedText}` }} onClick={ e => onClickChat(e) } />
|
||||
<span className="message" style={{ color: chat.chatColours }} dangerouslySetInnerHTML={{ __html: `${chat.formattedText}` }} onClick={e => onClickChat(e)} />
|
||||
</div>
|
||||
<div className="pointer" />
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user