Revert "Merge pull request #3804 from vector-im/dbkr/left_panel_for_newbies_2"

This reverts commit e6133820a2, reversing
changes made to d1db602b3a.
This commit is contained in:
David Baker 2017-05-16 16:27:58 +01:00
parent 0e0918d07c
commit 3cead032c2
7 changed files with 170 additions and 111 deletions

View file

@ -1,5 +1,4 @@
/*
Copyright 2017 Vector Creations Ltd
Copyright 2015, 2016 OpenMarket Ltd
Licensed under the Apache License, Version 2.0 (the "License");
@ -84,8 +83,6 @@ var RoomSubList = React.createClass({
incomingCall: React.PropTypes.object,
onShowMoreRooms: React.PropTypes.func,
searchFilter: React.PropTypes.string,
emptyContent: React.PropTypes.node, // content shown if the list is empty
headerItems: React.PropTypes.node, // content shown in the sublist header
},
getInitialState: function() {
@ -472,15 +469,16 @@ var RoomSubList = React.createClass({
render: function() {
var connectDropTarget = this.props.connectDropTarget;
var RoomDropTarget = sdk.getComponent('rooms.RoomDropTarget');
var TruncatedList = sdk.getComponent('elements.TruncatedList');
var label = this.props.collapsed ? null : this.props.label;
let content;
if (this.state.sortedList.length == 0) {
content = this.props.emptyContent;
} else {
content = this.makeRoomTiles();
//console.log("render: " + JSON.stringify(this.state.sortedList));
var target;
if (this.state.sortedList.length == 0 && this.props.editable) {
target = <RoomDropTarget label={ 'Drop here to ' + this.props.verb }/>;
}
var roomCount = this.props.list.length > 0 ? this.props.list.length : '';
@ -500,7 +498,8 @@ var RoomSubList = React.createClass({
if (!this.state.hidden) {
subList = <TruncatedList className={ classes } truncateAt={this.state.truncateAt}
createOverflowElement={this._createOverflowTile} >
{ content }
{ target }
{ this.makeRoomTiles() }
</TruncatedList>;
}
else {
@ -522,7 +521,6 @@ var RoomSubList = React.createClass({
roomNotificationCount={ this.roomNotificationCount() }
onClick={ this.onClick }
onHeaderClick={ this.props.onHeaderClick }
headerItems={this.props.headerItems}
/>
{ subList }
</div>
@ -544,7 +542,6 @@ var RoomSubList = React.createClass({
roomNotificationCount={ this.roomNotificationCount() }
onClick={ this.onClick }
onHeaderClick={ this.props.onHeaderClick }
headerItems={this.props.headerItems}
/>
: undefined }
{ (this.props.showSpinner && !this.state.hidden) ? <Loader /> : undefined }