From 7c29ae4a8ae69e1c7ff60b0bf15dcb29fa686ead Mon Sep 17 00:00:00 2001 From: JC Brand Date: Thu, 18 Jun 2020 16:54:12 +0200 Subject: [PATCH] Improve stying for /me messages Show the actions dropdown on the right, like with other messages, and don't wrap them. --- sass/_messages.scss | 23 +++++++++++------------ src/templates/chat_message.js | 19 ++++++++++--------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/sass/_messages.scss b/sass/_messages.scss index b139929a3..1641e9a42 100644 --- a/sass/_messages.scss +++ b/sass/_messages.scss @@ -281,21 +281,22 @@ min-width: var(--message-avatar-width); } + .chat-msg__author { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + font-family: var(--heading-font); + font-size: 115%; + font-weight: bold; + padding-bottom: 1px; // Hack to avoid cutting of text on the button + } + .chat-msg__heading { width: 100%; margin-top: 0.5em; padding-right: 0.25rem; padding-bottom: 0.25rem; - .chat-msg__author { - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - font-family: var(--heading-font); - font-size: 115%; - font-weight: bold; - padding-bottom: 1px; // Hack to avoid cutting of text on the button - } .badge { margin-left: 0.5em; font-family: var(--normal_font); @@ -307,10 +308,8 @@ } } &.chat-msg--action { - .chat-msg__content { - flex-wrap: wrap; + .chat-msg__message { flex-direction: row; - justify-content: flex-start; } .chat-msg__text { width: auto; diff --git a/src/templates/chat_message.js b/src/templates/chat_message.js index 9cc79d960..e14d2a588 100644 --- a/src/templates/chat_message.js +++ b/src/templates/chat_message.js @@ -17,17 +17,18 @@ export default (o) => { ${ o.shouldShowAvatar() ? renderAvatar(o.getAvatarData()) : '' }
- - ${ (o.is_me_message) ? html` - - ${o.hats.map(hat => html`${hat}`)} - ` : '' } - ${ o.is_me_message ? '**' : ''}${o.username} - ${ !o.is_me_message ? o.renderAvatarByline() : '' } - ${ o.is_encrypted ? html`` : '' } - + + ${ !o.is_me_message ? html` + + ${o.username} + ${ o.renderAvatarByline() } + ${ o.is_encrypted ? html`` : '' } + ` : '' }
+ ${ (o.is_me_message) ? html` +   + ${ o.is_me_message ? '**' : ''}${o.username} ` : '' } ${ o.is_retracted ? o.renderRetraction() : o.renderMessageText() }