From cd26f6331506bd9b0ee675a448cc3e7a7a267abd Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Mon, 6 Nov 2017 10:16:03 +0000 Subject: [PATCH 1/6] Do not init a group store when no groupId specified (in RightPanel), otherwise the store will happily send requests to the server for the `undefined` group. --- src/components/structures/RightPanel.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/structures/RightPanel.js b/src/components/structures/RightPanel.js index dedd715f9c..240a5b2efe 100644 --- a/src/components/structures/RightPanel.js +++ b/src/components/structures/RightPanel.js @@ -127,8 +127,9 @@ module.exports = React.createClass({ }, _initGroupStore(groupId) { + if (!groupId) return; this._groupStore = GroupStoreCache.getGroupStore( - this.context.matrixClient, this.props.groupId, + this.context.matrixClient, groupId, ); this._groupStore.registerListener(this.onGroupStoreUpdated); }, From e1eba559feecea1b0d4ee19d7f96b57af73b2e30 Mon Sep 17 00:00:00 2001 From: David Baker Date: Mon, 6 Nov 2017 15:12:28 +0000 Subject: [PATCH 2/6] CSS for room notif pills in composer --- .../vector/css/matrix-react-sdk/views/elements/_RichText.scss | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/skins/vector/css/matrix-react-sdk/views/elements/_RichText.scss b/src/skins/vector/css/matrix-react-sdk/views/elements/_RichText.scss index 8b7c8f06bb..474a123455 100644 --- a/src/skins/vector/css/matrix-react-sdk/views/elements/_RichText.scss +++ b/src/skins/vector/css/matrix-react-sdk/views/elements/_RichText.scss @@ -26,7 +26,8 @@ } .mx_EventTile_highlight .mx_EventTile_content .markdown-body a.mx_UserPill_me, -.mx_EventTile_content .mx_AtRoomPill { +.mx_EventTile_content .mx_AtRoomPill, +.mx_MessageComposer_input .mx_AtRoomPill { color: $accent-fg-color; background-color: $mention-user-pill-bg-color; padding-right: 5px; From d87d6cbc642ec7cd7613e56df82e507dfe52860f Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Mon, 6 Nov 2017 18:38:47 +0000 Subject: [PATCH 3/6] CSS for improving group creation UX, namely setting long description --- .../matrix-react-sdk/structures/_GroupView.scss | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/skins/vector/css/matrix-react-sdk/structures/_GroupView.scss b/src/skins/vector/css/matrix-react-sdk/structures/_GroupView.scss index 583ab2ce2e..c830a79d73 100644 --- a/src/skins/vector/css/matrix-react-sdk/structures/_GroupView.scss +++ b/src/skins/vector/css/matrix-react-sdk/structures/_GroupView.scss @@ -304,6 +304,18 @@ limitations under the License. } .mx_GroupView_groupDesc textarea { - width: 50%; + width: 100%; + max-width: 100%; height: 150px; } + +.mx_GroupView_groupDesc_placeholder { + background-color: $group-my-groups-placeholder-bg; + color: $group-my-groups-placeholder-fg; + border-radius: 10px; + text-align: center; + + cursor: pointer; + padding: 100px 20px; + margin: 20px 0px; +} From aa4feb056398287e5c9b89129216b74f6b6778a2 Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Mon, 6 Nov 2017 18:57:03 +0000 Subject: [PATCH 4/6] Info plinth CSS variables --- .../vector/css/matrix-react-sdk/structures/_GroupView.scss | 4 ++-- .../vector/css/matrix-react-sdk/structures/_MyGroups.scss | 4 ++-- src/skins/vector/css/themes/_base.scss | 6 +++--- src/skins/vector/css/themes/_dark.scss | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/skins/vector/css/matrix-react-sdk/structures/_GroupView.scss b/src/skins/vector/css/matrix-react-sdk/structures/_GroupView.scss index c830a79d73..2f7cd18720 100644 --- a/src/skins/vector/css/matrix-react-sdk/structures/_GroupView.scss +++ b/src/skins/vector/css/matrix-react-sdk/structures/_GroupView.scss @@ -310,8 +310,8 @@ limitations under the License. } .mx_GroupView_groupDesc_placeholder { - background-color: $group-my-groups-placeholder-bg; - color: $group-my-groups-placeholder-fg; + background-color: $info-plinth-bg-color; + color: $info-plinth-fg-color; border-radius: 10px; text-align: center; diff --git a/src/skins/vector/css/matrix-react-sdk/structures/_MyGroups.scss b/src/skins/vector/css/matrix-react-sdk/structures/_MyGroups.scss index d7cbda9a9b..f76aefe383 100644 --- a/src/skins/vector/css/matrix-react-sdk/structures/_MyGroups.scss +++ b/src/skins/vector/css/matrix-react-sdk/structures/_MyGroups.scss @@ -87,8 +87,8 @@ limitations under the License. } .mx_MyGroups_placeholder { - background-color: $group-my-groups-placeholder-bg; - color: $group-my-groups-placeholder-fg; + background-color: $info-plinth-bg-color; + color: $info-plinth-fg-color; line-height: 400px; border-radius: 10px; text-align: center; diff --git a/src/skins/vector/css/themes/_base.scss b/src/skins/vector/css/themes/_base.scss index 1a0fa5b400..d204829d49 100644 --- a/src/skins/vector/css/themes/_base.scss +++ b/src/skins/vector/css/themes/_base.scss @@ -22,9 +22,9 @@ $warning-color: #ff0064; $mention-user-pill-bg-color: #ff0064; $other-user-pill-bg-color: rgba(0, 0, 0, 0.1); -// groups -$group-my-groups-placeholder-bg: #f7f7f7; -$group-my-groups-placeholder-fg: #888; +// informational plinth +$info-plinth-bg-color: #f7f7f7; +$info-plinth-fg-color: #888; $preview-bar-bg-color: #f7f7f7; diff --git a/src/skins/vector/css/themes/_dark.scss b/src/skins/vector/css/themes/_dark.scss index 034bd748ef..d6fa88d6ce 100644 --- a/src/skins/vector/css/themes/_dark.scss +++ b/src/skins/vector/css/themes/_dark.scss @@ -21,7 +21,7 @@ $focus-brightness: 200%; $warning-color: #ff0064; // groups -$group-my-groups-placeholder-bg: #454545; +$info-plinth-bg-color: #454545; $other-user-pill-bg-color: rgba(255, 255, 255, 0.1); From e1d16acddb15ecbd0469cdcaa2811ed3febf0a31 Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Tue, 7 Nov 2017 14:09:04 +0000 Subject: [PATCH 5/6] Implement general-purpose tooltip "(?)"-style --- src/components/views/rooms/RoomTooltip.js | 11 +++- src/skins/vector/css/_components.scss | 1 + .../views/elements/_ToolTip.scss | 51 +++++++++++++++++++ 3 files changed, 61 insertions(+), 2 deletions(-) create mode 100644 src/skins/vector/css/matrix-react-sdk/views/elements/_ToolTip.scss diff --git a/src/components/views/rooms/RoomTooltip.js b/src/components/views/rooms/RoomTooltip.js index bbed5df8a5..714d57ca24 100644 --- a/src/components/views/rooms/RoomTooltip.js +++ b/src/components/views/rooms/RoomTooltip.js @@ -19,13 +19,16 @@ limitations under the License. var React = require('react'); var ReactDOM = require('react-dom'); var dis = require('matrix-react-sdk/lib/dispatcher'); +import classNames from 'classnames'; module.exports = React.createClass({ displayName: 'RoomTooltip', propTypes: { - // Alllow the tooltip to be styled by the parent element + // Class applied to the element used to position the tooltip className: React.PropTypes.string.isRequired, + // Class applied to the tooltip itself + tooltipClassName: React.PropTypes.string, // The tooltip is derived from either the room name or a label room: React.PropTypes.object, label: React.PropTypes.string, @@ -69,8 +72,12 @@ module.exports = React.createClass({ style.left = 6 + parent.getBoundingClientRect().right + window.pageXOffset; style.display = "block"; + const tooltipClasses = classNames( + "mx_RoomTooltip", this.props.tooltipClassName, + ); + var tooltip = ( -
+
{ label }
diff --git a/src/skins/vector/css/_components.scss b/src/skins/vector/css/_components.scss index 230b5ae477..a96eef42b7 100644 --- a/src/skins/vector/css/_components.scss +++ b/src/skins/vector/css/_components.scss @@ -35,6 +35,7 @@ @import "./matrix-react-sdk/views/elements/_ProgressBar.scss"; @import "./matrix-react-sdk/views/elements/_RichText.scss"; @import "./matrix-react-sdk/views/elements/_RoleButton.scss"; +@import "./matrix-react-sdk/views/elements/_ToolTip.scss"; @import "./matrix-react-sdk/views/groups/_GroupRoomList.scss"; @import "./matrix-react-sdk/views/login/_InteractiveAuthEntryComponents.scss"; @import "./matrix-react-sdk/views/login/_ServerConfig.scss"; diff --git a/src/skins/vector/css/matrix-react-sdk/views/elements/_ToolTip.scss b/src/skins/vector/css/matrix-react-sdk/views/elements/_ToolTip.scss new file mode 100644 index 0000000000..429ddcf544 --- /dev/null +++ b/src/skins/vector/css/matrix-react-sdk/views/elements/_ToolTip.scss @@ -0,0 +1,51 @@ +/* +Copyright 2017 New Vector Ltd. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +.mx_ToolTip { + display: inline-block; + width: 11px; + height: 11px; + margin-left: 5px; + + border: 2px solid $neutral-badge-color; + border-radius: 20px; + color: $neutral-badge-color; + + transition: opacity 0.2s ease-in; + opacity: 0.6; + + line-height: 11px; + text-align: center; + + cursor: pointer; +} + +.mx_ToolTip:hover { + opacity: 1.0; +} + +.mx_ToolTip_container { + position: relative; + top: -18px; + left: 4px; +} + +.mx_ToolTip_helpText { + width: 200px; + text-align: center; + line-height: 17px !important; +} + From 4c0e956cc1b3d64016e017f46ec33d5390a29c92 Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Tue, 7 Nov 2017 15:13:17 +0000 Subject: [PATCH 6/6] Name things in a sane way --- src/skins/vector/css/_components.scss | 2 +- .../views/elements/{_ToolTip.scss => _ToolTipButton.scss} | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) rename src/skins/vector/css/matrix-react-sdk/views/elements/{_ToolTip.scss => _ToolTipButton.scss} (90%) diff --git a/src/skins/vector/css/_components.scss b/src/skins/vector/css/_components.scss index a96eef42b7..767af80589 100644 --- a/src/skins/vector/css/_components.scss +++ b/src/skins/vector/css/_components.scss @@ -35,7 +35,7 @@ @import "./matrix-react-sdk/views/elements/_ProgressBar.scss"; @import "./matrix-react-sdk/views/elements/_RichText.scss"; @import "./matrix-react-sdk/views/elements/_RoleButton.scss"; -@import "./matrix-react-sdk/views/elements/_ToolTip.scss"; +@import "./matrix-react-sdk/views/elements/_ToolTipButton.scss"; @import "./matrix-react-sdk/views/groups/_GroupRoomList.scss"; @import "./matrix-react-sdk/views/login/_InteractiveAuthEntryComponents.scss"; @import "./matrix-react-sdk/views/login/_ServerConfig.scss"; diff --git a/src/skins/vector/css/matrix-react-sdk/views/elements/_ToolTip.scss b/src/skins/vector/css/matrix-react-sdk/views/elements/_ToolTipButton.scss similarity index 90% rename from src/skins/vector/css/matrix-react-sdk/views/elements/_ToolTip.scss rename to src/skins/vector/css/matrix-react-sdk/views/elements/_ToolTipButton.scss index 429ddcf544..ef9dd02b2a 100644 --- a/src/skins/vector/css/matrix-react-sdk/views/elements/_ToolTip.scss +++ b/src/skins/vector/css/matrix-react-sdk/views/elements/_ToolTipButton.scss @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ -.mx_ToolTip { +.mx_ToolTipButton { display: inline-block; width: 11px; height: 11px; @@ -33,17 +33,17 @@ limitations under the License. cursor: pointer; } -.mx_ToolTip:hover { +.mx_ToolTipButton:hover { opacity: 1.0; } -.mx_ToolTip_container { +.mx_ToolTipButton_container { position: relative; top: -18px; left: 4px; } -.mx_ToolTip_helpText { +.mx_ToolTipButton_helpText { width: 200px; text-align: center; line-height: 17px !important;