diff options
author | Gabe Kangas <gabek@real-ity.com> | 2021-12-09 14:06:48 -0800 |
---|---|---|
committer | Gabe Kangas <gabek@real-ity.com> | 2021-12-09 14:06:48 -0800 |
commit | 559c85856f496d8648206d5108b6f376553d83e9 (patch) | |
tree | 48904c8d15d87d91ea972afa79666f77226d4f47 | |
parent | a649e4e31ac3d5ff99702df32b47ca46f187bc24 (diff) |
Display moderator status in chat messages
-rw-r--r-- | webroot/js/components/chat/chat-message-view.js | 14 | ||||
-rw-r--r-- | webroot/styles/chat.css | 9 |
2 files changed, 19 insertions, 4 deletions
diff --git a/webroot/js/components/chat/chat-message-view.js b/webroot/js/components/chat/chat-message-view.js index 9705d4fdd..acad4192b 100644 --- a/webroot/js/components/chat/chat-message-view.js +++ b/webroot/js/components/chat/chat-message-view.js @@ -75,6 +75,14 @@ export default class ChatMessageView extends Component { isMessageModeratable ? 'moderatable' : '' }`; + const messageAuthorFlair = isModerator + ? html`<img + class="flair" + title="Moderator" + src="/img/moderator-nobackground.svg" + />` + : null; + return html` <div style=${backgroundStyle} @@ -84,12 +92,10 @@ export default class ChatMessageView extends Component { <div class="message-content break-words w-full"> <div style=${authorTextColor} - class="message-author font-bold${isAuthorModerator - ? ' moderator-flag' - : ''}" + class="message-author font-bold" title=${userMetadata} > - ${displayName} + ${messageAuthorFlair} ${displayName} </div> ${isMessageModeratable && html`<${ModeratorActions} diff --git a/webroot/styles/chat.css b/webroot/styles/chat.css index b22e5380a..12bc3dc64 100644 --- a/webroot/styles/chat.css +++ b/webroot/styles/chat.css @@ -270,7 +270,16 @@ top: 0; bottom: unset; } +.message-author { + display: flex; + height: 20px; + align-items: center; +} +.message-author .flair { + height: 70%; + margin-right: 5px; +} .moderator-menu-item { font-size: .875rem; |