From 4b13774585bc7952986d7d4db0103a7c3bbe0dcb Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Tue, 15 Jan 2019 10:20:27 -0600 Subject: [PATCH] Revert to avatar only when custom status disabled This returns to the previous behavior of avatar only without a button when the custom status feature is disabled so that you don't get pointer cursor for something that does nothing when clicked. The avatar ring spacing is kept consistent with and without the feature enabled by using a different class in CSS. --- .../avatars/_MemberStatusMessageAvatar.scss | 4 +-- .../avatars/MemberStatusMessageAvatar.js | 27 +++++++++---------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/res/css/views/avatars/_MemberStatusMessageAvatar.scss b/res/css/views/avatars/_MemberStatusMessageAvatar.scss index 03e7fdd188..7ac4036eef 100644 --- a/res/css/views/avatars/_MemberStatusMessageAvatar.scss +++ b/res/css/views/avatars/_MemberStatusMessageAvatar.scss @@ -14,13 +14,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -.mx_MemberStatusMessageAvatar .mx_BaseAvatar { +.mx_MessageComposer_avatar .mx_BaseAvatar { padding: 1.5px; border: 1.2px solid transparent; border-radius: 14px; } -.mx_MemberStatusMessageAvatar .mx_BaseAvatar_initial { +.mx_MessageComposer_avatar .mx_BaseAvatar_initial { left: 1.5px; } diff --git a/src/components/views/avatars/MemberStatusMessageAvatar.js b/src/components/views/avatars/MemberStatusMessageAvatar.js index a98fcaa537..0258c4b0c8 100644 --- a/src/components/views/avatars/MemberStatusMessageAvatar.js +++ b/src/components/views/avatars/MemberStatusMessageAvatar.js @@ -108,27 +108,26 @@ export default class MemberStatusMessageAvatar extends React.Component { }; render() { - const customStatusFeatureEnabled = - SettingsStore.isFeatureEnabled("feature_custom_status"); + const avatar = ; - let onClick = null; - let hasStatus = false; - - if (customStatusFeatureEnabled) { - onClick = this._onClick; - hasStatus = this.state.hasStatus; + if (!SettingsStore.isFeatureEnabled("feature_custom_status")) { + return avatar; } const classes = classNames({ "mx_MemberStatusMessageAvatar": true, - "mx_MemberStatusMessageAvatar_hasStatus": hasStatus, + "mx_MemberStatusMessageAvatar_hasStatus": this.state.hasStatus, }); - return - + return + {avatar} ; } }