From 344ab9813907e1b3f7d9dceee84978f832813bef Mon Sep 17 00:00:00 2001
From: Reed Garmsen <rgarmsen2295@gmail.com>
Date: Fri, 31 Jul 2015 14:06:00 -0700
Subject: Added spinner animation to replace save button when uploading a new
 profile picture

---
 web/react/components/user_settings.jsx | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

(limited to 'web/react/components/user_settings.jsx')

diff --git a/web/react/components/user_settings.jsx b/web/react/components/user_settings.jsx
index c574d2365..136f81ad3 100644
--- a/web/react/components/user_settings.jsx
+++ b/web/react/components/user_settings.jsx
@@ -748,6 +748,7 @@ var GeneralTab = React.createClass({
 
         var formData = new FormData();
         formData.append('image', picture, picture.name);
+        this.setState({loadingPicture: true});
 
         client.uploadProfileImage(formData,
             function() {
@@ -779,11 +780,10 @@ var GeneralTab = React.createClass({
     },
     updatePicture: function(e) {
         if (e.target.files && e.target.files[0]) {
-            this.setState({ picture: e.target.files[0] });
+            this.setState({picture: e.target.files[0]});
 
             this.submitActive = true;
             this.setState({client_error: null});
-
         } else {
             this.setState({picture: null});
         }
@@ -810,8 +810,8 @@ var GeneralTab = React.createClass({
     getInitialState: function() {
         var user = this.props.user;
 
-        return { username: user.username, first_name: user.first_name, last_name: user.last_name, nickname: user.nickname,
-                 email: user.email, picture: null };
+        return {username: user.username, first_name: user.first_name, last_name: user.last_name, nickname: user.nickname,
+                 email: user.email, picture: null, loadingPicture: false};
     },
     render: function() {
         var user = this.props.user;
@@ -1002,6 +1002,7 @@ var GeneralTab = React.createClass({
                     picture={this.state.picture}
                     pictureChange={this.updatePicture}
                     submitActive={this.submitActive}
+                    loadingPicture={this.state.loadingPicture}
                 />
             );
         } else {
-- 
cgit v1.2.3-1-g7c22

