Skip to content

Commit ddbc8df

Browse files
committed
switch from enums to string literals for SearchBar.Scope
1 parent 6aad99a commit ddbc8df

1 file changed

Lines changed: 5 additions & 10 deletions

File tree

‎src/skins/vector/views/molecules/SearchBar.js‎

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,18 @@ var sdk = require('matrix-react-sdk');
2323
module.exports = React.createClass({
2424
displayName: 'SearchBar',
2525

26-
Scope : {
27-
Room: 'Room',
28-
All: 'All',
29-
},
30-
3126
getInitialState: function() {
3227
return ({
33-
scope: this.Scope.Room
28+
scope: 'Room'
3429
});
3530
},
3631

3732
onThisRoomClick: function() {
38-
this.setState({ scope: this.Scope.Room });
33+
this.setState({ scope: 'Room' });
3934
},
4035

4136
onAllRoomsClick: function() {
42-
this.setState({ scope: this.Scope.All });
37+
this.setState({ scope: 'All' });
4338
},
4439

4540
onSearchChange: function(e) {
@@ -52,8 +47,8 @@ module.exports = React.createClass({
5247
return (
5348
<div className="mx_SearchBar">
5449
<input ref="search_term" className="mx_SearchBar_input" type="text" autoFocus={true} placeholder="Search..." onKeyDown={this.onSearchChange}/>
55-
<div className={"mx_SearchBar_button" + (this.state.scope !== this.Scope.Room ? " mx_SearchBar_unselected" : "")} onClick={this.onThisRoomClick}>This Room</div>
56-
<div className={"mx_SearchBar_button" + (this.state.scope !== this.Scope.All ? " mx_SearchBar_unselected" : "")} onClick={this.onAllRoomsClick}>All Rooms</div>
50+
<div className={"mx_SearchBar_button" + (this.state.scope !== 'Room' ? " mx_SearchBar_unselected" : "")} onClick={this.onThisRoomClick}>This Room</div>
51+
<div className={"mx_SearchBar_button" + (this.state.scope !== 'All' ? " mx_SearchBar_unselected" : "")} onClick={this.onAllRoomsClick}>All Rooms</div>
5752
<img className="mx_SearchBar_cancel" src="img/cancel-black.png" width="18" height="18" onClick={this.props.onCancelClick} />
5853
</div>
5954
);

0 commit comments

Comments
 (0)