diff options
author | Gabe Kangas <gabek@real-ity.com> | 2022-01-07 14:15:23 -0800 |
---|---|---|
committer | Gabe Kangas <gabek@real-ity.com> | 2022-01-07 14:15:23 -0800 |
commit | 20409eb14db8fb14e4746a14c5d5b97b8784a9f4 (patch) | |
tree | 3ebe04213266873096afbccc8061260148d0162f | |
parent | e23c6bcf59b8351f00b9b9b3a8bc599cd666e82e (diff) |
Add moderator icon to join messagegek/activity-pub-1
-rw-r--r-- | webroot/js/components/chat/message.js | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/webroot/js/components/chat/message.js b/webroot/js/components/chat/message.js index 691173d26..6018df119 100644 --- a/webroot/js/components/chat/message.js +++ b/webroot/js/components/chat/message.js @@ -102,8 +102,18 @@ export default function Message(props) { return html`<${SystemMessage} contents=${contents} />`; } else if (type === SOCKET_MESSAGE_TYPES.USER_JOINED) { const { displayName } = user; - const contents = html`<span class="font-bold">${displayName}</span> joined - the chat.`; + const isAuthorModerator = checkIsModerator(message); + const messageAuthorFlair = isAuthorModerator + ? html`<img + title="Moderator" + class="inline-block mr-1 w-3 h-3" + src="/img/moderator-nobackground.svg" + />` + : null; + const contents = html`<div> + <span class="font-bold">${messageAuthorFlair}${displayName}</span> + ${' '}joined the chat. + </div>`; return html`<${SystemMessage} contents=${contents} />`; } else if (type === SOCKET_MESSAGE_TYPES.CHAT_ACTION) { const contents = html`<span |