Hide role dropdown icon in profile viewer (#215)

Signed-off-by: Ajay Bura <ajbura@gmail.com>
This commit is contained in:
Ajay Bura 2022-01-05 17:50:50 +05:30
parent 53f3ccc888
commit be905ac7be

View file

@ -261,6 +261,7 @@ function ProfileViewer() {
function renderProfile() {
const member = room.getMember(userId) || mx.getUser(userId) || {};
const avatarMxc = member.getMxcAvatarUrl?.() || member.avatarUrl;
const canChangeRole = room.currentState.maySendEvent('m.room.power_levels', mx.getUserId());
return (
<div className="profile-viewer">
@ -277,7 +278,7 @@ function ProfileViewer() {
</div>
<div className="profile-viewer__user__role">
<Text variant="b3">Role</Text>
<Button iconSrc={ChevronBottomIC}>{getPowerLabel(member.powerLevel) || 'Member'}</Button>
<Button iconSrc={canChangeRole ? ChevronBottomIC : null}>{getPowerLabel(member.powerLevel) || 'Member'}</Button>
</div>
</div>
<SessionInfo userId={userId} />