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

This commit is contained in:
Richard Lewis 2017-06-06 14:50:43 +01:00
parent dc4f321707
commit e9f110a4c5

View file

@ -140,18 +140,21 @@ module.exports = React.createClass({
userId={this.props.userId}
/>);
return (
<div className="mx_AppsDrawer">
<div id="apps" className="mx_AppsContainer">
{apps}
</div>
<div onClick={this.onClickAddWidget}
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 (
<div className="mx_AppsDrawer">
<div id="apps" className="mx_AppsContainer">
{apps}
</div>
{addWidget}
</div>
);
},