@@ -19,6 +19,7 @@ limitations under the License.
1919var React = require ( 'react' ) ;
2020var MatrixClientPeg = require ( 'matrix-react-sdk/lib/MatrixClientPeg' ) ;
2121var sdk = require ( 'matrix-react-sdk' ) ;
22+ var classNames = require ( 'classnames' ) ;
2223
2324module . exports = React . createClass ( {
2425 displayName : 'SearchBar' ,
@@ -48,12 +49,16 @@ module.exports = React.createClass({
4849 } ,
4950
5051 render : function ( ) {
52+ var searchButtonClasses = classNames ( { mx_SearchBar_searchButton : true , mx_SearchBar_searching : this . props . searchInProgress || true } ) ;
53+ var thisRoomClasses = classNames ( { mx_SearchBar_button : true , mx_SearchBar_unselected : this . state . scope !== 'Room' } ) ;
54+ var allRoomsClasses = classNames ( { mx_SearchBar_button : true , mx_SearchBar_unselected : this . state . scope !== 'All' } ) ;
55+
5156 return (
5257 < div className = "mx_SearchBar" >
5358 < input ref = "search_term" className = "mx_SearchBar_input" type = "text" autoFocus = { true } placeholder = "Search..." onKeyDown = { this . onSearchChange } />
54- < img className = "mx_SearchBar_searchButton" src = "img/search-button.svg" width = "37" height = "37" onClick = { this . onSearch } / >
55- < div className = { "mx_SearchBar_button" + ( this . state . scope !== 'Room' ? " mx_SearchBar_unselected" : "" ) } onClick = { this . onThisRoomClick } > This Room</ div >
56- < div className = { "mx_SearchBar_button" + ( this . state . scope !== 'All' ? " mx_SearchBar_unselected" : "" ) } onClick = { this . onAllRoomsClick } > All Rooms</ div >
59+ < div className = { searchButtonClasses } onClick = { this . onSearch } > < img src = "img/search-button.svg" width = "37" height = "37" alt = "Search" /> </ div >
60+ < div className = { thisRoomClasses } onClick = { this . onThisRoomClick } > This Room</ div >
61+ < div className = { allRoomsClasses } onClick = { this . onAllRoomsClick } > All Rooms</ div >
5762 < img className = "mx_SearchBar_cancel" src = "img/cancel.svg" width = "18" height = "18" onClick = { this . props . onCancelClick } />
5863 </ div >
5964 ) ;
0 commit comments