mirror of
https://github.com/element-hq/element-web.git
synced 2024-12-05 05:38:41 +03:00
Don't show add widget if there are more than one existing widgets
This commit is contained in:
parent
dc4f321707
commit
e9f110a4c5
1 changed files with 10 additions and 7 deletions
|
@ -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>
|
||||
);
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue