From fea3fed460e7e04f3b3110c2b7286b814c3cd936 Mon Sep 17 00:00:00 2001 From: Matthew Hodgson Date: Fri, 11 Dec 2015 02:24:58 +0000 Subject: [PATCH] animate the search button whilst searching --- src/components/views/rooms/RoomDNDView.js | 1 - src/components/views/rooms/SearchBar.js | 11 ++++++++--- src/skins/vector/css/molecules/SearchBar.css | 14 ++++++++++++++ src/skins/vector/img/search-button.svg | 9 ++++----- 4 files changed, 26 insertions(+), 9 deletions(-) diff --git a/src/components/views/rooms/RoomDNDView.js b/src/components/views/rooms/RoomDNDView.js index 9642c561..9b01629d 100644 --- a/src/components/views/rooms/RoomDNDView.js +++ b/src/components/views/rooms/RoomDNDView.js @@ -19,7 +19,6 @@ limitations under the License. var React = require('react'); var DragSource = require('react-dnd').DragSource; var DropTarget = require('react-dnd').DropTarget; -var classNames = require('classnames'); var dis = require("matrix-react-sdk/lib/dispatcher"); var MatrixClientPeg = require('matrix-react-sdk/lib/MatrixClientPeg'); diff --git a/src/components/views/rooms/SearchBar.js b/src/components/views/rooms/SearchBar.js index 08cd340c..aaa03ee8 100644 --- a/src/components/views/rooms/SearchBar.js +++ b/src/components/views/rooms/SearchBar.js @@ -19,6 +19,7 @@ limitations under the License. var React = require('react'); var MatrixClientPeg = require('matrix-react-sdk/lib/MatrixClientPeg'); var sdk = require('matrix-react-sdk'); +var classNames = require('classnames'); module.exports = React.createClass({ displayName: 'SearchBar', @@ -48,12 +49,16 @@ module.exports = React.createClass({ }, render: function() { + var searchButtonClasses = classNames({ mx_SearchBar_searchButton : true, mx_SearchBar_searching: this.props.searchInProgress || true }); + var thisRoomClasses = classNames({ mx_SearchBar_button : true, mx_SearchBar_unselected : this.state.scope !== 'Room' }); + var allRoomsClasses = classNames({ mx_SearchBar_button : true, mx_SearchBar_unselected : this.state.scope !== 'All' }); + return (
- -
This Room
-
All Rooms
+
Search
+
This Room
+
All Rooms
); diff --git a/src/skins/vector/css/molecules/SearchBar.css b/src/skins/vector/css/molecules/SearchBar.css index ba1de56c..3698c852 100644 --- a/src/skins/vector/css/molecules/SearchBar.css +++ b/src/skins/vector/css/molecules/SearchBar.css @@ -35,7 +35,21 @@ limitations under the License. .mx_SearchBar_searchButton { cursor: pointer; margin-right: 10px; + width: 37px; + height: 37px; border-radius: 0px 3px 3px 0px; + background-color: #76CFA6; +} + +@keyframes pulsate { + 0% { opacity: 1.0; } + 50% { opacity: 0.25; } + 100% { opacity: 1.0; } +} + +.mx_SearchBar_searching img { + animation: pulsate 0.75s ease-out; + animation-iteration-count: infinite; } .mx_SearchBar_button { diff --git a/src/skins/vector/img/search-button.svg b/src/skins/vector/img/search-button.svg index d92d0b8d..f4808842 100644 --- a/src/skins/vector/img/search-button.svg +++ b/src/skins/vector/img/search-button.svg @@ -1,14 +1,13 @@ - + icon_search Created with Sketch. - - - - + + +