PR feedback

This commit is contained in:
David Baker 2017-07-07 18:34:40 +01:00
parent b420a8389d
commit 1e713557bb
4 changed files with 37 additions and 34 deletions

View file

@ -79,7 +79,7 @@ export default React.createClass({
} }
let nameNode; let nameNode;
if (summary.profile.name) { if (summary.profile && summary.profile.name) {
nameNode = <div className="mx_RoomHeader_name"> nameNode = <div className="mx_RoomHeader_name">
<span>{summary.profile.name}</span> <span>{summary.profile.name}</span>
<span className="mx_GroupView_header_groupid"> <span className="mx_GroupView_header_groupid">
@ -92,6 +92,8 @@ export default React.createClass({
</div>; </div>;
} }
const groupAvatarUrl = summary.profile ? summary.profile.avatar_url : null;
return ( return (
<div className="mx_GroupView"> <div className="mx_GroupView">
<div className="mx_RoomHeader"> <div className="mx_RoomHeader">
@ -99,7 +101,7 @@ export default React.createClass({
<div className="mx_RoomHeader_avatar"> <div className="mx_RoomHeader_avatar">
<GroupAvatar <GroupAvatar
groupId={this.props.groupId} groupId={this.props.groupId}
groupAvatarUrl={summary.profile.avatar_url} groupAvatarUrl={groupAvatarUrl}
width={48} height={48} width={48} height={48}
/> />
</div> </div>

View file

@ -61,9 +61,6 @@ export default withMatrixClient(React.createClass({
this._fetch(); this._fetch();
}, },
componentWillUnmount: function() {
},
_onCreateGroupClick: function() { _onCreateGroupClick: function() {
const CreateGroupDialog = sdk.getComponent("dialogs.CreateGroupDialog"); const CreateGroupDialog = sdk.getComponent("dialogs.CreateGroupDialog");
Modal.createDialog(CreateGroupDialog); Modal.createDialog(CreateGroupDialog);
@ -73,7 +70,7 @@ export default withMatrixClient(React.createClass({
this.props.matrixClient.getJoinedGroups().done((result) => { this.props.matrixClient.getJoinedGroups().done((result) => {
this.setState({groups: result.groups, error: null}); this.setState({groups: result.groups, error: null});
}, (err) => { }, (err) => {
this.setState({result: null, error: err}); this.setState({groups: null, error: err});
}); });
}, },
@ -93,12 +90,12 @@ export default withMatrixClient(React.createClass({
); );
}); });
content = <div> content = <div>
<div>{_t('You are a member of these groups')}:</div> <div>{_t('You are a member of these groups:')}</div>
{groupNodes} {groupNodes}
</div>; </div>;
} else if (this.state.error) { } else if (this.state.error) {
content = <div className="mx_MyGroups_error"> content = <div className="mx_MyGroups_error">
Error whilst fetching joined groups {_t('Error whilst fetching joined groups')}
</div>; </div>;
} else { } else {
content = <Loader />; content = <Loader />;

View file

@ -130,10 +130,10 @@ export default React.createClass({
render: function() { render: function() {
const BaseDialog = sdk.getComponent('views.dialogs.BaseDialog'); const BaseDialog = sdk.getComponent('views.dialogs.BaseDialog');
const Loader = sdk.getComponent("elements.Spinner"); const Spinner = sdk.getComponent('elements.Spinner');
if (this.state.creating) { if (this.state.creating) {
return <Loader />; return <Spinner />;
} }
let createErrorNode; let createErrorNode;
@ -154,6 +154,7 @@ export default React.createClass({
> >
<form onSubmit={this._onFormSubmit}> <form onSubmit={this._onFormSubmit}>
<div className="mx_Dialog_content"> <div className="mx_Dialog_content">
<div className="mx_CreateGroupDialog_inputRow">
<div className="mx_CreateGroupDialog_label"> <div className="mx_CreateGroupDialog_label">
<label htmlFor="groupname">{_t('Group Name')}</label> <label htmlFor="groupname">{_t('Group Name')}</label>
</div> </div>
@ -165,7 +166,8 @@ export default React.createClass({
value={this.state.groupName} value={this.state.groupName}
/> />
</div> </div>
<br /> </div>
<div className="mx_CreateGroupDialog_inputRow">
<div className="mx_CreateGroupDialog_label"> <div className="mx_CreateGroupDialog_label">
<label htmlFor="groupid">{_t('Group ID')}</label> <label htmlFor="groupid">{_t('Group ID')}</label>
</div> </div>
@ -178,6 +180,7 @@ export default React.createClass({
value={this.state.groupId} value={this.state.groupId}
/> />
</div> </div>
</div>
<div className="error"> <div className="error">
{this.state.groupIdError} {this.state.groupIdError}
</div> </div>

View file

@ -948,9 +948,10 @@
"Group IDs must be of the form +localpart:%(domain)s": "Group IDs must be of the form +localpart:%(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", "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", "Room creation failed": "Room creation failed",
"You are a member of these groups": "You are a member of these groups", "You are a member of these groups:": "You are a member of these groups:",
"Create a group to represent your community! Define a set of rooms and your own custom homepage to mark out your space in the Matrix universe.": "Create a group to represent your community! Define a set of rooms and your own custom homepage to mark out your space in the Matrix universe.", "Create a group to represent your community! Define a set of rooms and your own custom homepage to mark out your space in the Matrix universe.": "Create a group to represent your community! Define a set of rooms and your own custom homepage to mark out your space in the Matrix universe.",
"Join an existing group": "Join an existing group", "Join an existing group": "Join an existing group",
"To join an exisitng group you'll have to know its group identifier; this will look something like <i>+example:matrix.org</i>.": "To join an exisitng group you'll have to know its group identifier; this will look something like <i>+example:matrix.org</i>.", "To join an exisitng group you'll have to know its group identifier; this will look something like <i>+example:matrix.org</i>.": "To join an exisitng group you'll have to know its group identifier; this will look something like <i>+example:matrix.org</i>.",
"Autocomplete Delay (ms):": "Autocomplete Delay (ms):" "Autocomplete Delay (ms):": "Autocomplete Delay (ms):",
"Error whilst fetching joined groups": "Error whilst fetching joined groups"
} }