11/*
2+ Copyright 2017 Vector Creations Ltd
23Copyright 2015, 2016 OpenMarket Ltd
34
45Licensed under the Apache License, Version 2.0 (the "License");
@@ -84,6 +85,7 @@ var RoomSubList = React.createClass({
8485 onShowMoreRooms : React . PropTypes . func ,
8586 searchFilter : React . PropTypes . string ,
8687 emptyContent : React . PropTypes . node , // content shown if the list is empty
88+ headerItems : React . PropTypes . node , // content shown in the sublist header
8789 } ,
8890
8991 getInitialState : function ( ) {
@@ -553,7 +555,20 @@ var RoomSubList = React.createClass({
553555
554556 return connectDropTarget (
555557 < div >
556- { this . _getHeaderJsx ( ) }
558+ < RoomSubListHeader
559+ ref = 'header'
560+ label = { this . props . label }
561+ tagName = { this . props . tagName }
562+ roomCount = { roomCount }
563+ collapsed = { this . props . collapsed }
564+ hidden = { this . state . hidden }
565+ incomingCall = { this . props . incomingCall }
566+ isIncomingCallRoom = { isIncomingCallRoom }
567+ roomNotificationCount = { this . roomNotificationCount ( ) }
568+ onClick = { this . onClick }
569+ onHeaderClick = { this . props . onHeaderClick }
570+ headerItems = { this . props . headerItems }
571+ />
557572 { subList }
558573 </ div >
559574 ) ;
@@ -562,7 +577,21 @@ var RoomSubList = React.createClass({
562577 var Loader = sdk . getComponent ( "elements.Spinner" ) ;
563578 return (
564579 < div className = "mx_RoomSubList" >
565- { this . props . alwaysShowHeader ? this . _getHeaderJsx ( ) : undefined }
580+ { this . props . alwaysShowHeader ?
581+ < RoomSubListHeader
582+ ref = 'header'
583+ label = { this . props . label }
584+ tagName = { this . props . tagName }
585+ roomCount = { roomCount }
586+ collapsed = { this . props . collapsed }
587+ hidden = { this . state . hidden }
588+ isIncomingCallRoom = { isIncomingCallRoom }
589+ roomNotificationCount = { this . roomNotificationCount ( ) }
590+ onClick = { this . onClick }
591+ onHeaderClick = { this . props . onHeaderClick }
592+ headerItems = { this . props . headerItems }
593+ />
594+ : undefined }
566595 { ( this . props . showSpinner && ! this . state . hidden ) ? < Loader /> : undefined }
567596 </ div >
568597 ) ;
0 commit comments