From a06b420942229979500c4da4b5ac858c9910d08b Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Fri, 15 Apr 2016 17:55:00 +0100 Subject: [PATCH] wire up searchbox filtering --- src/components/views/elements/EditableText.js | 1 + src/components/views/rooms/RoomList.js | 33 ++++++++----------- 2 files changed, 15 insertions(+), 19 deletions(-) diff --git a/src/components/views/elements/EditableText.js b/src/components/views/elements/EditableText.js index 683cfe4fc8..9218fe820e 100644 --- a/src/components/views/elements/EditableText.js +++ b/src/components/views/elements/EditableText.js @@ -24,6 +24,7 @@ const KEY_WINDOWS = 91; module.exports = React.createClass({ displayName: 'EditableText', + propTypes: { onValueChanged: React.PropTypes.func, initialValue: React.PropTypes.string, diff --git a/src/components/views/rooms/RoomList.js b/src/components/views/rooms/RoomList.js index c63e59dfe4..b1017ac538 100644 --- a/src/components/views/rooms/RoomList.js +++ b/src/components/views/rooms/RoomList.js @@ -34,7 +34,8 @@ module.exports = React.createClass({ propTypes: { ConferenceHandler: React.PropTypes.any, collapsed: React.PropTypes.bool, - currentRoom: React.PropTypes.string + currentRoom: React.PropTypes.string, + searchFilter: React.PropTypes.string, }, getInitialState: function() { @@ -82,7 +83,7 @@ module.exports = React.createClass({ else { this.setState({ incomingCall: null - }); + }); } break; } @@ -312,12 +313,6 @@ module.exports = React.createClass({ } }, - onShowClick: function() { - dis.dispatch({ - action: 'show_left_panel', - }); - }, - onShowMoreRooms: function() { // kick gemini in the balls to get it to wake up // XXX: uuuuuuugh. @@ -325,18 +320,12 @@ module.exports = React.createClass({ }, render: function() { - var expandButton = this.props.collapsed ? - > : - null; - var RoomSubList = sdk.getComponent('structures.RoomSubList'); var self = this; return (
- { expandButton } - + searchFilter={ self.props.searchFilter } + onShowMoreRooms={ self.onShowMoreRooms } /> + searchFilter={ self.props.searchFilter } + onShowMoreRooms={ self.onShowMoreRooms } /> + searchFilter={ self.props.searchFilter } + onShowMoreRooms={ self.onShowMoreRooms } /> { Object.keys(self.state.lists).map(function(tagName) { if (!tagName.match(/^(m\.(favourite|lowpriority)|im\.vector\.fake\.(invite|recent|archived))$/)) { @@ -379,6 +371,7 @@ module.exports = React.createClass({ selectedRoom={ self.props.selectedRoom } incomingCall={ self.state.incomingCall } collapsed={ self.props.collapsed } + searchFilter={ self.props.searchFilter } onShowMoreRooms={ self.onShowMoreRooms } /> } @@ -393,7 +386,8 @@ module.exports = React.createClass({ selectedRoom={ self.props.selectedRoom } incomingCall={ self.state.incomingCall } collapsed={ self.props.collapsed } - onShowMoreRooms={ this.onShowMoreRooms } /> + searchFilter={ self.props.searchFilter } + onShowMoreRooms={ self.onShowMoreRooms } /> + searchFilter={ self.props.searchFilter } + onShowMoreRooms={ self.onShowMoreRooms } />
);