From 5514d816833cf860bb76260918b87a57b4bccd4a Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Tue, 24 Oct 2017 23:01:40 +0100 Subject: [PATCH] Add Mention button to MemberInfo Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- src/components/views/rooms/MemberInfo.js | 17 ++++++++++++++++- src/i18n/strings/en_EN.json | 1 + 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/components/views/rooms/MemberInfo.js b/src/components/views/rooms/MemberInfo.js index 2f8bd30a72..e281a93558 100644 --- a/src/components/views/rooms/MemberInfo.js +++ b/src/components/views/rooms/MemberInfo.js @@ -629,6 +629,7 @@ module.exports = withMatrixClient(React.createClass({ const member = this.props.member; let ignoreButton = null; + let insertPillButton = null; let readReceiptButton = null; // Only allow the user to ignore the user if its not ourselves @@ -653,21 +654,35 @@ module.exports = withMatrixClient(React.createClass({ }); }; + const onInsertPillButton = function() { + dis.dispatch({ + action: 'insert_mention', + user_id: member.userId, + }); + }; + readReceiptButton = ( { _t('Jump to read receipt') } ); + + insertPillButton = ( + + { _t('Mention') } + + ); } } - if (!ignoreButton && !readReceiptButton) return null; + if (!ignoreButton && !readReceiptButton && !insertPillButton) return null; return (

{ _t("User Options") }

{ readReceiptButton } + { insertPillButton } { ignoreButton }
diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 492113989b..ea5c12d86c 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -152,6 +152,7 @@ "%(widgetName)s widget removed by %(senderName)s": "%(widgetName)s widget removed by %(senderName)s", "Communities": "Communities", "Message Pinning": "Message Pinning", + "Mention": "Mention", "%(displayName)s is typing": "%(displayName)s is typing", "%(names)s and one other are typing": "%(names)s and one other are typing", "%(names)s and %(count)s others are typing|other": "%(names)s and %(count)s others are typing",