Loading animations for buttons

This commit is contained in:
James Barnsley
2017-05-19 08:59:29 +12:00
parent 0998a6d3ca
commit f4299e659a
2 changed files with 43 additions and 9 deletions

View File

@ -66,20 +66,18 @@ class SpotifyAuthenticationFrame extends React.Component{
renderAuthorizeButton(){
if( this.state.authorizing ){
return (
<button disabled>
<FontAwesome name="circle-o-notch" spin />
&nbsp;
<button className="working">
Authorizing...
</button>
);
)
}else if( this.props.authorized ){
return (
<button className="destructive" onClick={() => this.props.spotifyActions.authorizationRevoked()}>Log out</button>
);
)
}else{
return (
<button className="primary" onClick={() => this.startAuthorization()}>Log in</button>
);
)
}
}
@ -88,9 +86,7 @@ class SpotifyAuthenticationFrame extends React.Component{
if (this.props.refreshing_token){
return (
<button disabled>
<FontAwesome name="circle-o-notch" spin />
&nbsp;
<button className="working">
Refreshing...
</button>
);