mirror of
https://github.com/element-hq/element-web.git
synced 2024-12-13 17:02:02 +03:00
Convert to API objects
& remove redundant power label
This commit is contained in:
parent
c1546ceb59
commit
4daf9064d9
2 changed files with 6 additions and 7 deletions
|
@ -26,6 +26,7 @@ import DMRoomMap from '../../../utils/DMRoomMap';
|
|||
import Unread from '../../../Unread';
|
||||
import { GroupMemberType } from '../../../groups';
|
||||
import { findReadReceiptFromUserId } from '../../../utils/Receipt';
|
||||
import { groupMemberFromApiObject } from '../../../groups';
|
||||
import withMatrixClient from '../../../wrappers/withMatrixClient';
|
||||
import AccessibleButton from '../elements/AccessibleButton';
|
||||
import GeminiScrollbar from 'react-gemini-scrollbar';
|
||||
|
@ -48,7 +49,9 @@ module.exports = withMatrixClient(React.createClass({
|
|||
this.setState({fetching: true});
|
||||
this.props.matrixClient.getGroupUsers(this.props.groupId).then((result) => {
|
||||
this.setState({
|
||||
members: result.chunk,
|
||||
members: result.chunk.map((apiMember) => {
|
||||
return groupMemberFromApiObject(apiMember);
|
||||
}),
|
||||
fetching: false,
|
||||
});
|
||||
}).catch((e) => {
|
||||
|
@ -91,7 +94,7 @@ module.exports = withMatrixClient(React.createClass({
|
|||
|
||||
let targetIsInGroup = false;
|
||||
for (const m of this.state.members) {
|
||||
if (m.user_id == this.props.member.userId) {
|
||||
if (m.userId == this.props.member.userId) {
|
||||
targetIsInGroup = true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -44,10 +44,6 @@ export default withMatrixClient(React.createClass({
|
|||
});
|
||||
},
|
||||
|
||||
getPowerLabel: function() {
|
||||
return _t("%(userName)s (power %(powerLevelNumber)s)", {userName: this.props.member.userId, powerLevelNumber: this.props.member.powerLevel});
|
||||
},
|
||||
|
||||
render: function() {
|
||||
const BaseAvatar = sdk.getComponent('avatars.BaseAvatar');
|
||||
const EntityTile = sdk.getComponent('rooms.EntityTile');
|
||||
|
@ -60,7 +56,7 @@ export default withMatrixClient(React.createClass({
|
|||
|
||||
return (
|
||||
<EntityTile presenceState="online"
|
||||
avatarJsx={av} title={this.getPowerLabel()} onClick={this.onClick}
|
||||
avatarJsx={av} onClick={this.onClick}
|
||||
name={name} powerLevel={0} suppressOnHover={true}
|
||||
/>
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue