diff --git a/res/css/views/rooms/_WhoIsTypingTile.scss b/res/css/views/rooms/_WhoIsTypingTile.scss index 1323523618..7e62d95f56 100644 --- a/res/css/views/rooms/_WhoIsTypingTile.scss +++ b/res/css/views/rooms/_WhoIsTypingTile.scss @@ -15,73 +15,31 @@ limitations under the License. */ .mx_WhoIsTypingTile { - margin-left: 65px; - min-height: 50px; - font-size: 14px; + margin-left: -18px; //offset padding from mx_RoomView_MessageList to center avatars + height: 40px; + display: flex; + align-items: center; } /* position the indicator in the same place horizontally as .mx_EventTile_avatar. */ -.mx_WhoIsTypingTile_indicator { - padding-left: 17px; - padding-right: 12px; - margin-left: -73px; - margin-top: 15px; - float: left; - width: 24px; +.mx_WhoIsTypingTile_avatars { + flex: 0 0 83px; // 18 + 65 text-align: center; } -.mx_WhoIsTypingTile_placeholderIndicator span { - color: $primary-fg-color; - opacity: 0.5; - position: relative; - top: -4px; -/* - animation-duration: 1s; - animation-name: bounce; - animation-direction: alternate; - animation-iteration-count: infinite; -*/ +.mx_WhoIsTypingTile_avatars > :not(:first-child) { + margin-left: -12px; } -.mx_WhoIsTypingTile_placeholderIndicator span:nth-child(1) { - animation-delay: 0.3s; -} -.mx_WhoIsTypingTile_placeholderIndicator span:nth-child(2) { - animation-delay: 0.6s; -} -.mx_WhoIsTypingTile_placeholderIndicator span:nth-child(3) { - animation-delay: 0.9s; -} - -@keyframes bounce { - from { - opacity: 0.5; - top: 0; - } - - to { - opacity: 0.2; - top: -3px; - } -} - -.mx_WhoIsTypingTile_typingIndicatorAvatars { - width: 52px; - margin-top: -1px; -} - -.mx_WhoIsTypingTile_typingIndicatorAvatars .mx_BaseAvatar_image { - margin-right: -12px; +.mx_WhoIsTypingTile_avatars .mx_BaseAvatar_image { border: 1px solid $primary-bg-color; } -.mx_WhoIsTypingTile_typingIndicatorAvatars .mx_BaseAvatar_initial { - padding-left: 1px; +.mx_WhoIsTypingTile_avatars .mx_BaseAvatar_initial { padding-top: 1px; } -.mx_WhoIsTypingTile_typingIndicatorRemaining { +.mx_WhoIsTypingTile_remainingAvatarPlaceholder { display: inline-block; color: #acacac; background-color: #ddd; @@ -93,31 +51,34 @@ limitations under the License. font-size: 0.8em; vertical-align: top; text-align: center; - position: absolute; } -.mx_WhoIsTypingTile_typingBar { - height: 50px; - line-height: 50px; - - color: $primary-fg-color; - opacity: 0.5; - overflow-y: hidden; - display: block; +.mx_WhoIsTypingTile_label { + flex: 1; + font-size: 14px; + font-weight: 600; + color: $eventtile-meta-color; } +.mx_WhoIsTypingTile_label > span:after { + background-image: url('../../img/spinner.gif'); + background-size: 16px; + background-position: right; + background-repeat: no-repeat; + right: 0px; + top: 0; + bottom: 0; + margin-left: 10px; + width: 16px; + height: 16px; + display: inline-block; + vertical-align: middle; + content: ""; +} .mx_MatrixChat_useCompactLayout { + .mx_WhoIsTypingTile { - min-height: 40px; - } - - .mx_WhoIsTypingTile_indicator { - margin-top: 10px; - } - - .mx_WhoIsTypingTile_typingBar { - height: 40px; - line-height: 40px; + height: 35px; } } diff --git a/res/themes/dharma/css/_dharma.scss b/res/themes/dharma/css/_dharma.scss index 0b53202240..07da833cfb 100644 --- a/res/themes/dharma/css/_dharma.scss +++ b/res/themes/dharma/css/_dharma.scss @@ -119,6 +119,7 @@ $topleftmenu-color: #212121; $roomheader-color: #45474a; $roomheader-addroom-color: #929eb4; $roomtopic-color: #9fa9ba; +$eventtile-meta-color: $roomtopic-color; // ******************** diff --git a/res/themes/light/css/_base.scss b/res/themes/light/css/_base.scss index bee9157279..4c41037229 100644 --- a/res/themes/light/css/_base.scss +++ b/res/themes/light/css/_base.scss @@ -115,7 +115,7 @@ $topleftmenu-color: $primary-fg-color; $roomheader-color: $primary-fg-color; $roomheader-addroom-color: $primary-bg-color; $roomtopic-color: $settings-grey-fg-color; - +$eventtile-meta-color: $roomtopic-color; // ******************** $roomtile-name-color: rgba(69, 69, 69, 0.8); diff --git a/src/components/views/rooms/WhoIsTypingTile.js b/src/components/views/rooms/WhoIsTypingTile.js index 994bd757b3..80ac64ec3e 100644 --- a/src/components/views/rooms/WhoIsTypingTile.js +++ b/src/components/views/rooms/WhoIsTypingTile.js @@ -48,14 +48,14 @@ module.exports = React.createClass({ }, componentWillMount: function() { - // MatrixClientPeg.get().on("RoomMember.typing", this.onRoomMemberTyping); + MatrixClientPeg.get().on("RoomMember.typing", this.onRoomMemberTyping); }, componentWillUnmount: function() { // we may have entirely lost our client as we're logging out before clicking login on the guest bar... const client = MatrixClientPeg.get(); if (client) { - // client.removeListener("RoomMember.typing", this.onRoomMemberTyping); + client.removeListener("RoomMember.typing", this.onRoomMemberTyping); } }, @@ -88,7 +88,7 @@ module.exports = React.createClass({ if (othersCount > 0) { avatars.push( - + +{ othersCount } , ); @@ -97,36 +97,24 @@ module.exports = React.createClass({ return avatars; }, - // return suitable content for the main (text) part of the status bar. - _getContent: function() { - const EmojiText = sdk.getComponent('elements.EmojiText'); - + render: function() { const typingString = WhoIsTyping.whoIsTypingString( this.state.usersTyping, this.props.whoIsTypingLimit, ); - if (typingString) { - return ( -
- { typingString } -
- ); + if (!typingString) { + return (
); } - }, - render: function() { - // if (this.state.usersTyping.length === 0) { - // return; - // } + const EmojiText = sdk.getComponent('elements.EmojiText'); + return (
-
-
- { this._renderTypingIndicatorAvatars(this.props.whoIsTypingLimit) } -
+
+ { this._renderTypingIndicatorAvatars(this.props.whoIsTypingLimit) }
-
- { this._getContent() } +
+ { typingString }
);