Skip to content

Commit fea3fed

Browse files
committed
animate the search button whilst searching
1 parent 4c82d86 commit fea3fed

4 files changed

Lines changed: 26 additions & 9 deletions

File tree

‎src/components/views/rooms/RoomDNDView.js‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ limitations under the License.
1919
var React = require('react');
2020
var DragSource = require('react-dnd').DragSource;
2121
var DropTarget = require('react-dnd').DropTarget;
22-
var classNames = require('classnames');
2322

2423
var dis = require("matrix-react-sdk/lib/dispatcher");
2524
var MatrixClientPeg = require('matrix-react-sdk/lib/MatrixClientPeg');

‎src/components/views/rooms/SearchBar.js‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ limitations under the License.
1919
var React = require('react');
2020
var MatrixClientPeg = require('matrix-react-sdk/lib/MatrixClientPeg');
2121
var sdk = require('matrix-react-sdk');
22+
var classNames = require('classnames');
2223

2324
module.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
);

‎src/skins/vector/css/molecules/SearchBar.css‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,21 @@ limitations under the License.
3535
.mx_SearchBar_searchButton {
3636
cursor: pointer;
3737
margin-right: 10px;
38+
width: 37px;
39+
height: 37px;
3840
border-radius: 0px 3px 3px 0px;
41+
background-color: #76CFA6;
42+
}
43+
44+
@keyframes pulsate {
45+
0% { opacity: 1.0; }
46+
50% { opacity: 0.25; }
47+
100% { opacity: 1.0; }
48+
}
49+
50+
.mx_SearchBar_searching img {
51+
animation: pulsate 0.75s ease-out;
52+
animation-iteration-count: infinite;
3953
}
4054

4155
.mx_SearchBar_button {

‎src/skins/vector/img/search-button.svg‎

Lines changed: 4 additions & 5 deletions
Loading

0 commit comments

Comments
 (0)