Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 6eeb91e

Browse files
committed
Display group member profile (avatar/displayname) in ConfirmUserActionDialog
Fixes element-hq/element-web#5486
1 parent be5e672 commit 6eeb91e

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/components/views/dialogs/ConfirmUserActionDialog.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,11 @@ export default React.createClass({
104104
name = this.props.member.name;
105105
userId = this.props.member.userId;
106106
} else {
107-
// we don't get this info from the API yet
108-
avatar = <BaseAvatar name={this.props.groupMember.userId} width={48} height={48} />;
109-
name = this.props.groupMember.userId;
107+
const httpAvatarUrl = this.props.groupMember.avatarUrl ?
108+
this.props.matrixClient.mxcUrlToHttp(this.props.groupMember.avatarUrl, 48, 48) : null;
109+
name = this.props.groupMember.displayname || this.props.groupMember.userId;
110110
userId = this.props.groupMember.userId;
111+
avatar = <BaseAvatar name={name} url={httpAvatarUrl} width={48} height={48} />;
111112
}
112113

113114
return (

src/components/views/groups/GroupMemberInfo.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ module.exports = React.createClass({
8383
_onKick: function() {
8484
const ConfirmUserActionDialog = sdk.getComponent("dialogs.ConfirmUserActionDialog");
8585
Modal.createDialog(ConfirmUserActionDialog, {
86+
matrixClient: this.context.matrixClient,
8687
groupMember: this.props.groupMember,
8788
action: this.state.isUserInvited ? _t('Disinvite') : _t('Remove from community'),
8889
title: this.state.isUserInvited ? _t('Disinvite this user from community?')

0 commit comments

Comments
 (0)