Display group member profile (avatar/displayname) in ConfirmUserActionDialog

Fixes https://github.com/vector-im/riot-web/issues/5486
This commit is contained in:
Luke Barnard 2017-11-09 12:24:20 +00:00
parent be5e67245b
commit 6eeb91ee2e
2 changed files with 5 additions and 3 deletions

View file

@ -104,10 +104,11 @@ export default React.createClass({
name = this.props.member.name; name = this.props.member.name;
userId = this.props.member.userId; userId = this.props.member.userId;
} else { } else {
// we don't get this info from the API yet const httpAvatarUrl = this.props.groupMember.avatarUrl ?
avatar = <BaseAvatar name={this.props.groupMember.userId} width={48} height={48} />; this.props.matrixClient.mxcUrlToHttp(this.props.groupMember.avatarUrl, 48, 48) : null;
name = this.props.groupMember.userId; name = this.props.groupMember.displayname || this.props.groupMember.userId;
userId = this.props.groupMember.userId; userId = this.props.groupMember.userId;
avatar = <BaseAvatar name={name} url={httpAvatarUrl} width={48} height={48} />;
} }
return ( return (

View file

@ -83,6 +83,7 @@ module.exports = React.createClass({
_onKick: function() { _onKick: function() {
const ConfirmUserActionDialog = sdk.getComponent("dialogs.ConfirmUserActionDialog"); const ConfirmUserActionDialog = sdk.getComponent("dialogs.ConfirmUserActionDialog");
Modal.createDialog(ConfirmUserActionDialog, { Modal.createDialog(ConfirmUserActionDialog, {
matrixClient: this.context.matrixClient,
groupMember: this.props.groupMember, groupMember: this.props.groupMember,
action: this.state.isUserInvited ? _t('Disinvite') : _t('Remove from community'), action: this.state.isUserInvited ? _t('Disinvite') : _t('Remove from community'),
title: this.state.isUserInvited ? _t('Disinvite this user from community?') title: this.state.isUserInvited ? _t('Disinvite this user from community?')