mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-17 14:05:04 +08:00
Add reason for ban in room settings
This commit is contained in:
parent
3b7ce49eab
commit
f940d2c100
@ -40,6 +40,7 @@ function parseIntWithDefault(val, def) {
|
|||||||
const BannedUser = React.createClass({
|
const BannedUser = React.createClass({
|
||||||
propTypes: {
|
propTypes: {
|
||||||
member: React.PropTypes.object.isRequired, // js-sdk RoomMember
|
member: React.PropTypes.object.isRequired, // js-sdk RoomMember
|
||||||
|
reason: React.PropTypes.string,
|
||||||
},
|
},
|
||||||
|
|
||||||
_onUnbanClick: function() {
|
_onUnbanClick: function() {
|
||||||
@ -73,10 +74,11 @@ const BannedUser = React.createClass({
|
|||||||
>
|
>
|
||||||
{ _t('Unban') }
|
{ _t('Unban') }
|
||||||
</AccessibleButton>
|
</AccessibleButton>
|
||||||
{this.props.member.userId}
|
<strong>{this.props.member.name}</strong>
|
||||||
|
{this.props.reason ? " " +_t('Reason') + ": " + this.props.reason : ""}
|
||||||
</li>
|
</li>
|
||||||
);
|
);
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
module.exports = React.createClass({
|
module.exports = React.createClass({
|
||||||
@ -662,16 +664,17 @@ module.exports = React.createClass({
|
|||||||
userLevelsSection = <div>{ _t('No users have specific privileges in this room') }.</div>;
|
userLevelsSection = <div>{ _t('No users have specific privileges in this room') }.</div>;
|
||||||
}
|
}
|
||||||
|
|
||||||
var banned = this.props.room.getMembersWithMembership("ban");
|
const banned = this.props.room.getMembersWithMembership("ban");
|
||||||
var bannedUsersSection;
|
let bannedUsersSection;
|
||||||
if (banned.length) {
|
if (banned.length) {
|
||||||
bannedUsersSection =
|
bannedUsersSection =
|
||||||
<div>
|
<div>
|
||||||
<h3>{ _t('Banned users') }</h3>
|
<h3>{ _t('Banned users') }</h3>
|
||||||
<ul className="mx_RoomSettings_banned">
|
<ul className="mx_RoomSettings_banned">
|
||||||
{banned.map(function(member) {
|
{banned.map(function(member) {
|
||||||
|
const banEvent = member.events.member.getContent();
|
||||||
return (
|
return (
|
||||||
<BannedUser key={member.userId} member={member} />
|
<BannedUser key={member.userId} member={member} reason={banEvent.reason} />
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
</ul>
|
</ul>
|
||||||
|
Loading…
Reference in New Issue
Block a user