Don't show add widget if there are more than one existing widgets

pull/21833/head
Richard Lewis 2017-06-06 14:50:43 +01:00
parent dc4f321707
commit e9f110a4c5
1 changed files with 10 additions and 7 deletions

View File

@ -140,18 +140,21 @@ module.exports = React.createClass({
userId={this.props.userId} userId={this.props.userId}
/>); />);
return ( const addWidget = this.state.apps && this.state.apps.length < 2 &&
<div className="mx_AppsDrawer"> (<div onClick={this.onClickAddWidget}
<div id="apps" className="mx_AppsContainer">
{apps}
</div>
<div onClick={this.onClickAddWidget}
role="button" role="button"
tabIndex="0" tabIndex="0"
className="mx_AddWidget_button" className="mx_AddWidget_button"
title="Add a widget"> title="Add a widget">
[+] Add a widget [+] Add a widget
</div>);
return (
<div className="mx_AppsDrawer">
<div id="apps" className="mx_AppsContainer">
{apps}
</div> </div>
{addWidget}
</div> </div>
); );
}, },