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}
/>); />);
const addWidget = this.state.apps && this.state.apps.length < 2 &&
(<div onClick={this.onClickAddWidget}
role="button"
tabIndex="0"
className="mx_AddWidget_button"
title="Add a widget">
[+] Add a widget
</div>);
return ( return (
<div className="mx_AppsDrawer"> <div className="mx_AppsDrawer">
<div id="apps" className="mx_AppsContainer"> <div id="apps" className="mx_AppsContainer">
{apps} {apps}
</div> </div>
<div onClick={this.onClickAddWidget} {addWidget}
role="button"
tabIndex="0"
className="mx_AddWidget_button"
title="Add a widget">
[+] Add a widget
</div>
</div> </div>
); );
}, },