From ee6e36cd904adb49c468f3897c9b607b5f031567 Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 18 Aug 2017 11:23:55 +0100 Subject: [PATCH] Allow extra tiles to be put into room sub lists So we can put in tiles for group invites & other stuff --- src/components/structures/RoomSubList.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/components/structures/RoomSubList.js b/src/components/structures/RoomSubList.js index 7c6b16229c..0ca595c861 100644 --- a/src/components/structures/RoomSubList.js +++ b/src/components/structures/RoomSubList.js @@ -88,6 +88,7 @@ var RoomSubList = React.createClass({ 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 + extraTiles: React.PropTypes.arrayOf(React.PropTypes.node), // extra elements added beneath tiles }, getInitialState: function() { @@ -101,7 +102,8 @@ var RoomSubList = React.createClass({ getDefaultProps: function() { return { onHeaderClick: function() {}, // NOP - onShowMoreRooms: function() {} // NOP + onShowMoreRooms: function() {}, // NOP + extraTiles: [], }; }, @@ -532,13 +534,14 @@ var RoomSubList = React.createClass({ var label = this.props.collapsed ? null : this.props.label; let content; - if (this.state.sortedList.length == 0 && !this.props.searchFilter) { + if (this.state.sortedList.length == 0 && !this.props.searchFilter && !this.props.extraTiles) { content = this.props.emptyContent; } else { content = this.makeRoomTiles(); + content.push(...this.props.extraTiles); } - if (this.state.sortedList.length > 0 || this.props.editable) { + if (this.state.sortedList.length > 0 || this.props.extraTiles.length > 0 || this.props.editable) { var subList; var classes = "mx_RoomSubList";