Fix lint errors

This commit is contained in:
David Baker 2017-07-07 10:41:59 +01:00
parent 45986306cc
commit 183f45bc1f
3 changed files with 20 additions and 16 deletions

View file

@ -269,17 +269,19 @@ export default React.createClass({
break; break;
case PageTypes.HomePage: case PageTypes.HomePage:
// If team server config is present, pass the teamServerURL. props.teamToken {
// must also be set for the team page to be displayed, otherwise the // If team server config is present, pass the teamServerURL. props.teamToken
// welcomePageUrl is used (which might be undefined). // must also be set for the team page to be displayed, otherwise the
const teamServerUrl = this.props.config.teamServerConfig ? // welcomePageUrl is used (which might be undefined).
this.props.config.teamServerConfig.teamServerURL : null; const teamServerUrl = this.props.config.teamServerConfig ?
this.props.config.teamServerConfig.teamServerURL : null;
page_element = <HomePage page_element = <HomePage
teamServerUrl={teamServerUrl} teamServerUrl={teamServerUrl}
teamToken={this.props.teamToken} teamToken={this.props.teamToken}
homePageUrl={this.props.config.welcomePageUrl} homePageUrl={this.props.config.welcomePageUrl}
/>; />;
}
break; break;
case PageTypes.UserView: case PageTypes.UserView:

View file

@ -40,7 +40,7 @@ const GroupTile = React.createClass({
render: function() { render: function() {
return <a onClick={this.onClick} href="#">{this.props.groupId}</a>; return <a onClick={this.onClick} href="#">{this.props.groupId}</a>;
} },
}); });
export default WithMatrixClient(React.createClass({ export default WithMatrixClient(React.createClass({
@ -84,12 +84,12 @@ export default WithMatrixClient(React.createClass({
let content; let content;
if (this.state.groups) { if (this.state.groups) {
let groupNodes = []; const groupNodes = [];
this.state.groups.forEach((g) => { this.state.groups.forEach((g) => {
groupNodes.push( groupNodes.push(
<div key={g}> <div key={g}>
<GroupTile groupId={g} /> <GroupTile groupId={g} />
</div> </div>,
); );
}); });
content = <div> content = <div>
@ -117,7 +117,7 @@ export default WithMatrixClient(React.createClass({
{_t( {_t(
'Create a group to represent your community! '+ 'Create a group to represent your community! '+
'Define a set of rooms and your own custom homepage '+ 'Define a set of rooms and your own custom homepage '+
'to mark out your space in the Matrix universe.' 'to mark out your space in the Matrix universe.',
)} )}
</div> </div>
<div className="mx_MyGroups_joinBox"> <div className="mx_MyGroups_joinBox">

View file

@ -38,7 +38,7 @@ export default React.createClass({
}; };
}, },
getGroupAvatarUrl: function(props) { getGroupAvatarUrl: function() {
return MatrixClientPeg.get().mxcUrlToHttp( return MatrixClientPeg.get().mxcUrlToHttp(
this.props.groupAvatarUrl, this.props.groupAvatarUrl,
this.props.width, this.props.width,
@ -50,6 +50,8 @@ export default React.createClass({
render: function() { render: function() {
const BaseAvatar = sdk.getComponent("avatars.BaseAvatar"); const BaseAvatar = sdk.getComponent("avatars.BaseAvatar");
// extract the props we use from props so we can pass any others through // extract the props we use from props so we can pass any others through
// should consider adding this as a global rule in js-sdk?
/*eslint no-unused-vars: ["error", { "ignoreRestSiblings": true }]*/
const {groupId, groupAvatarUrl, ...otherProps} = this.props; const {groupId, groupAvatarUrl, ...otherProps} = this.props;
return ( return (
@ -60,5 +62,5 @@ export default React.createClass({
{...otherProps} {...otherProps}
/> />
); );
} },
}); });