update hyperlink style condition

This commit is contained in:
bobakoftadeh 2019-04-18 20:35:04 +00:00
parent ff8d826cf3
commit 282dc259c8

View File

@ -140,6 +140,8 @@ export default class MessageListItem extends Component {
const dateTime = new Date(time);
const regEx = /<a[^>]+>/i;
if (!user) {
return this.renderSystemMessage();
}
@ -169,7 +171,7 @@ export default class MessageListItem extends Component {
<div className={styles.messages}>
{messages.map(message => (
<Message
className={(message.text.includes('href') ? styles.hyperlink : styles.message)}
className={(regEx.test(message.text) ? styles.hyperlink : styles.message)}
key={message.id}
text={message.text}
time={message.time}