mirror of
https://github.com/element-hq/element-web
synced 2024-11-27 03:36:07 +03:00
Rename profile object properties to camelCase
Also, add correct PropTypes for FlairAvatar
This commit is contained in:
parent
e64cc3b666
commit
41a9ff22fb
1 changed files with 11 additions and 5 deletions
|
@ -121,8 +121,11 @@ async function getGroupProfileCached(matrixClient, groupId) {
|
|||
return groupProfiles[groupId];
|
||||
}
|
||||
|
||||
groupProfiles[groupId] = await matrixClient.getGroupProfile(groupId);
|
||||
groupProfiles[groupId].group_id = groupId;
|
||||
const profile = await matrixClient.getGroupProfile(groupId);
|
||||
groupProfiles[groupId] = {
|
||||
groupId,
|
||||
avatarUrl: profile.avatar_url,
|
||||
};
|
||||
|
||||
return groupProfiles[groupId];
|
||||
}
|
||||
|
@ -139,19 +142,22 @@ class FlairAvatar extends React.Component {
|
|||
ev.stopPropagation();
|
||||
dis.dispatch({
|
||||
action: 'view_group',
|
||||
group_id: this.props.groupProfile.group_id,
|
||||
group_id: this.props.groupProfile.groupId,
|
||||
});
|
||||
}
|
||||
|
||||
render() {
|
||||
const httpUrl = this.context.matrixClient.mxcUrlToHttp(
|
||||
this.props.groupProfile.avatar_url, 14, 14, 'scale', false);
|
||||
this.props.groupProfile.avatarUrl, 14, 14, 'scale', false);
|
||||
return <img src={httpUrl} width="14px" height="14px" onClick={this.onClick}/>;
|
||||
}
|
||||
}
|
||||
|
||||
FlairAvatar.propTypes = {
|
||||
groupProfile: PropTypes.string,
|
||||
groupProfile: PropTypes.shape({
|
||||
groupId: PropTypes.string.isRequired,
|
||||
avatarUrl: PropTypes.string.isRequired,
|
||||
}),
|
||||
};
|
||||
|
||||
FlairAvatar.contextTypes = {
|
||||
|
|
Loading…
Reference in a new issue