Show displayname & avatar url in group member list
This commit is contained in:
parent
45c4eeba01
commit
4a36e32c8d
3 changed files with 11 additions and 4 deletions
|
@ -91,10 +91,10 @@ export default withMatrixClient(React.createClass({
|
||||||
if (query) {
|
if (query) {
|
||||||
memberList = memberList.filter((m) => {
|
memberList = memberList.filter((m) => {
|
||||||
// TODO: add this when we have this info from the API
|
// TODO: add this when we have this info from the API
|
||||||
//const matchesName = m.name.toLowerCase().indexOf(query) !== -1;
|
const matchesName = m.displayname.toLowerCase().indexOf(query) !== -1;
|
||||||
const matchesId = m.userId.toLowerCase().includes(query);
|
const matchesId = m.userId.toLowerCase().includes(query);
|
||||||
|
|
||||||
if (/*!matchesName &&*/ !matchesId) {
|
if (!matchesName && !matchesId) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -47,10 +47,13 @@ export default withMatrixClient(React.createClass({
|
||||||
const BaseAvatar = sdk.getComponent('avatars.BaseAvatar');
|
const BaseAvatar = sdk.getComponent('avatars.BaseAvatar');
|
||||||
const EntityTile = sdk.getComponent('rooms.EntityTile');
|
const EntityTile = sdk.getComponent('rooms.EntityTile');
|
||||||
|
|
||||||
const name = this.props.member.userId;
|
const name = this.props.member.displayname || this.props.member.userId;
|
||||||
|
|
||||||
const av = (
|
const av = (
|
||||||
<BaseAvatar name={this.props.member.userId} width={36} height={36} />
|
<BaseAvatar name={this.props.member.userId}
|
||||||
|
width={36} height={36}
|
||||||
|
url={this.props.matrixClient.mxcUrlToHttp(this.props.member.avatarUrl)}
|
||||||
|
/>
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -18,10 +18,14 @@ import PropTypes from 'prop-types';
|
||||||
|
|
||||||
export const GroupMemberType = PropTypes.shape({
|
export const GroupMemberType = PropTypes.shape({
|
||||||
userId: PropTypes.string.isRequired,
|
userId: PropTypes.string.isRequired,
|
||||||
|
displayname: PropTypes.string,
|
||||||
|
avatarUrl: PropTypes.string,
|
||||||
});
|
});
|
||||||
|
|
||||||
export function groupMemberFromApiObject(apiObject) {
|
export function groupMemberFromApiObject(apiObject) {
|
||||||
return {
|
return {
|
||||||
userId: apiObject.user_id,
|
userId: apiObject.user_id,
|
||||||
|
displayname: apiObject.displayname,
|
||||||
|
avatarUrl: apiObject.avatar_url,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue