restyle SearchBox & make it more reusable

as we can reuse it in the room header
This commit is contained in:
Bruno Windels 2018-11-05 09:35:44 +01:00
parent 064662380f
commit 6db81edf6c
3 changed files with 34 additions and 83 deletions

View file

@ -171,6 +171,12 @@ const LeftPanel = React.createClass({
this.setState({ searchFilter: term });
},
onSearchCleared: function(source) {
if (source === "keyboard") {
dis.dispatch({action: 'focus_composer'});
}
},
collectRoomList: function(ref) {
this._roomList = ref;
},
@ -195,7 +201,7 @@ const LeftPanel = React.createClass({
);
const searchBox = !this.props.collapsed ?
<SearchBox onSearch={ this.onSearch } /> :
<SearchBox onSearch={ this.onSearch } onCleared={ this.onSearchCleared } /> :
undefined;
return (