Behave better on rooms with no avatar / name

Also add translation strings
This commit is contained in:
David Baker 2017-06-29 17:17:43 +01:00
parent f99c540b3d
commit d6ecec1987
2 changed files with 33 additions and 11 deletions

View file

@ -71,29 +71,42 @@ module.exports = React.createClass({
return <Loader />;
} else if (this.state.summary) {
const summary = this.state.summary;
let avatarUrl = null;
let avatarNode = null;
if (summary.profile && summary.profile.avatar_url) {
avatarUrl = MatrixClientPeg.get().mxcUrlToHttp(summary.profile.avatar_url);
avatarNode = <BaseAvatar
url={MatrixClientPeg.get().mxcUrlToHttp(summary.profile.avatar_url)}
name={summary.profile.name}
width={48} height={48}
/>;
}
let description = null;
if (summary.profile && summary.profile.long_description) {
description = sanitizedHtmlNode(summary.profile.long_description);
}
let nameNode;
if (summary.profile.name) {
nameNode = <div className="mx_RoomHeader_name">
<span>{summary.profile.name}</span>
<span className="mx_GroupView_header_groupid">
({this.props.groupId})
</span>
</div>;
} else {
nameNode = <div className="mx_RoomHeader_name">
<span>{this.props.groupId}</span>
</div>;
}
return (
<div className="mx_GroupView">
<div className="mx_RoomHeader">
<div className="mx_RoomHeader_wrapper">
<div className="mx_RoomHeader_avatar">
<BaseAvatar url={avatarUrl} name={summary.profile.name}
width={48} height={48} />
{avatarNode}
</div>
<div className="mx_RoomHeader_info">
<div className="mx_RoomHeader_name">
<span>{summary.profile.name}</span>
<span className="mx_GroupView_header_groupid">
({this.props.groupId})
</span>
</div>
{nameNode}
<div className="mx_RoomHeader_topic">
{summary.profile.short_description}
</div>

View file

@ -927,5 +927,14 @@
"This Home server does not support groups": "This Home server does not support groups",
"Loading device info...": "Loading device info...",
"Groups": "Groups",
"Create a new group": "Create a new group"
"Create a new group": "Create a new group",
"Create Group": "Create Group",
"Group Name": "Group Name",
"Example": "Example",
"Create": "Create",
"Group ID": "Group ID",
"+example:%(domain)s": "+example:%(domain)s",
"Group IDs must be of the form +localpart:%(domain)s": "Group IDs must be of the form +localpart:%(domain)s",
"It is currently only possible to create groups on your own home server: use a group ID ending with %(domain)s": "It is currently only possible to create groups on your own home server: use a group ID ending with %(domain)s",
"Room creation failed": "Room creation failed"
}