mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-17 22:14:58 +08:00
Add Mention button to MemberInfo
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
0463f0e581
commit
5514d81683
@ -629,6 +629,7 @@ module.exports = withMatrixClient(React.createClass({
|
|||||||
const member = this.props.member;
|
const member = this.props.member;
|
||||||
|
|
||||||
let ignoreButton = null;
|
let ignoreButton = null;
|
||||||
|
let insertPillButton = null;
|
||||||
let readReceiptButton = null;
|
let readReceiptButton = null;
|
||||||
|
|
||||||
// Only allow the user to ignore the user if its not ourselves
|
// 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 = (
|
readReceiptButton = (
|
||||||
<AccessibleButton onClick={onReadReceiptButton} className="mx_MemberInfo_field">
|
<AccessibleButton onClick={onReadReceiptButton} className="mx_MemberInfo_field">
|
||||||
{ _t('Jump to read receipt') }
|
{ _t('Jump to read receipt') }
|
||||||
</AccessibleButton>
|
</AccessibleButton>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
insertPillButton = (
|
||||||
|
<AccessibleButton onClick={onInsertPillButton} className={"mx_MemberInfo_field"}>
|
||||||
|
{ _t('Mention') }
|
||||||
|
</AccessibleButton>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ignoreButton && !readReceiptButton) return null;
|
if (!ignoreButton && !readReceiptButton && !insertPillButton) return null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<h3>{ _t("User Options") }</h3>
|
<h3>{ _t("User Options") }</h3>
|
||||||
<div className="mx_MemberInfo_buttons">
|
<div className="mx_MemberInfo_buttons">
|
||||||
{ readReceiptButton }
|
{ readReceiptButton }
|
||||||
|
{ insertPillButton }
|
||||||
{ ignoreButton }
|
{ ignoreButton }
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -152,6 +152,7 @@
|
|||||||
"%(widgetName)s widget removed by %(senderName)s": "%(widgetName)s widget removed by %(senderName)s",
|
"%(widgetName)s widget removed by %(senderName)s": "%(widgetName)s widget removed by %(senderName)s",
|
||||||
"Communities": "Communities",
|
"Communities": "Communities",
|
||||||
"Message Pinning": "Message Pinning",
|
"Message Pinning": "Message Pinning",
|
||||||
|
"Mention": "Mention",
|
||||||
"%(displayName)s is typing": "%(displayName)s is typing",
|
"%(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 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",
|
"%(names)s and %(count)s others are typing|other": "%(names)s and %(count)s others are typing",
|
||||||
|
Loading…
Reference in New Issue
Block a user