Skip to content

Commit ee6e36c

Browse files
committed
Allow extra tiles to be put into room sub lists
So we can put in tiles for group invites & other stuff
1 parent 1a7a670 commit ee6e36c

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

‎src/components/structures/RoomSubList.js‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ var RoomSubList = React.createClass({
8888
searchFilter: React.PropTypes.string,
8989
emptyContent: React.PropTypes.node, // content shown if the list is empty
9090
headerItems: React.PropTypes.node, // content shown in the sublist header
91+
extraTiles: React.PropTypes.arrayOf(React.PropTypes.node), // extra elements added beneath tiles
9192
},
9293

9394
getInitialState: function() {
@@ -101,7 +102,8 @@ var RoomSubList = React.createClass({
101102
getDefaultProps: function() {
102103
return {
103104
onHeaderClick: function() {}, // NOP
104-
onShowMoreRooms: function() {} // NOP
105+
onShowMoreRooms: function() {}, // NOP
106+
extraTiles: [],
105107
};
106108
},
107109

@@ -532,13 +534,14 @@ var RoomSubList = React.createClass({
532534
var label = this.props.collapsed ? null : this.props.label;
533535

534536
let content;
535-
if (this.state.sortedList.length == 0 && !this.props.searchFilter) {
537+
if (this.state.sortedList.length == 0 && !this.props.searchFilter && !this.props.extraTiles) {
536538
content = this.props.emptyContent;
537539
} else {
538540
content = this.makeRoomTiles();
541+
content.push(...this.props.extraTiles);
539542
}
540543

541-
if (this.state.sortedList.length > 0 || this.props.editable) {
544+
if (this.state.sortedList.length > 0 || this.props.extraTiles.length > 0 || this.props.editable) {
542545
var subList;
543546
var classes = "mx_RoomSubList";
544547

0 commit comments

Comments
 (0)