mirror of
https://github.com/element-hq/element-web.git
synced 2024-12-03 03:50:42 +03:00
Behave better on rooms with no avatar / name
Also add translation strings
This commit is contained in:
parent
f99c540b3d
commit
d6ecec1987
2 changed files with 33 additions and 11 deletions
|
@ -71,29 +71,42 @@ module.exports = React.createClass({
|
||||||
return <Loader />;
|
return <Loader />;
|
||||||
} else if (this.state.summary) {
|
} else if (this.state.summary) {
|
||||||
const summary = this.state.summary;
|
const summary = this.state.summary;
|
||||||
let avatarUrl = null;
|
let avatarNode = null;
|
||||||
if (summary.profile && summary.profile.avatar_url) {
|
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;
|
let description = null;
|
||||||
if (summary.profile && summary.profile.long_description) {
|
if (summary.profile && summary.profile.long_description) {
|
||||||
description = sanitizedHtmlNode(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 (
|
return (
|
||||||
<div className="mx_GroupView">
|
<div className="mx_GroupView">
|
||||||
<div className="mx_RoomHeader">
|
<div className="mx_RoomHeader">
|
||||||
<div className="mx_RoomHeader_wrapper">
|
<div className="mx_RoomHeader_wrapper">
|
||||||
<div className="mx_RoomHeader_avatar">
|
<div className="mx_RoomHeader_avatar">
|
||||||
<BaseAvatar url={avatarUrl} name={summary.profile.name}
|
{avatarNode}
|
||||||
width={48} height={48} />
|
|
||||||
</div>
|
</div>
|
||||||
<div className="mx_RoomHeader_info">
|
<div className="mx_RoomHeader_info">
|
||||||
<div className="mx_RoomHeader_name">
|
{nameNode}
|
||||||
<span>{summary.profile.name}</span>
|
|
||||||
<span className="mx_GroupView_header_groupid">
|
|
||||||
({this.props.groupId})
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div className="mx_RoomHeader_topic">
|
<div className="mx_RoomHeader_topic">
|
||||||
{summary.profile.short_description}
|
{summary.profile.short_description}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -927,5 +927,14 @@
|
||||||
"This Home server does not support groups": "This Home server does not support groups",
|
"This Home server does not support groups": "This Home server does not support groups",
|
||||||
"Loading device info...": "Loading device info...",
|
"Loading device info...": "Loading device info...",
|
||||||
"Groups": "Groups",
|
"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"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue