show vaguely accurate default avatar

This commit is contained in:
Matthew Hodgson 2016-02-15 22:01:22 +02:00
parent dfbc88d421
commit 576de32ce4

View file

@ -110,19 +110,17 @@ module.exports = React.createClass({
}, },
render: function() { render: function() {
var RoomAvatar = sdk.getComponent('avatars.RoomAvatar');
var avatarImg; var avatarImg;
// Having just set an avatar we just display that since it will take a little // Having just set an avatar we just display that since it will take a little
// time to propagate through to the RoomAvatar. // time to propagate through to the RoomAvatar.
if (this.props.room && !this.avatarSet) { if (this.props.room && !this.avatarSet) {
var RoomAvatar = sdk.getComponent('avatars.RoomAvatar');
avatarImg = <RoomAvatar room={this.props.room} width={ this.props.width } height={ this.props.height } resizeMethod='crop' />; avatarImg = <RoomAvatar room={this.props.room} width={ this.props.width } height={ this.props.height } resizeMethod='crop' />;
} else { } else {
var style = { var BaseAvatar = sdk.getComponent("avatars.BaseAvatar");
width: this.props.width, // XXX: FIXME: once we track in the JS what our own displayname is(!) then use it here rather than ?
height: this.props.height, avatarImg = <BaseAvatar width={this.props.width} height={this.props.height} resizeMethod='crop'
objectFit: 'cover', name='?' idName={ MatrixClientPeg.get().getUserIdLocalpart() } url={this.state.avatarUrl} />
};
avatarImg = <img className="mx_BaseAvatar_image" src={this.state.avatarUrl} style={style} />;
} }
var uploadSection; var uploadSection;