From 2304ae76f56b569a98aa51a5cc1d3fd5de0f104c Mon Sep 17 00:00:00 2001 From: Ben Gotow Date: Mon, 25 Sep 2017 23:50:12 -0700 Subject: [PATCH] Put refresh spinner back on Identity preferences tab --- .../lib/items/dev-mode-notif.jsx | 2 +- .../lib/tabs/preferences-identity.jsx | 45 +++++++++++++++++-- .../styles/preferences-identity.less | 4 +- 3 files changed, 45 insertions(+), 6 deletions(-) diff --git a/app/internal_packages/notifications/lib/items/dev-mode-notif.jsx b/app/internal_packages/notifications/lib/items/dev-mode-notif.jsx index 901df6aa1..3df5535c9 100644 --- a/app/internal_packages/notifications/lib/items/dev-mode-notif.jsx +++ b/app/internal_packages/notifications/lib/items/dev-mode-notif.jsx @@ -20,7 +20,7 @@ export default class DevModeNotification extends React.Component { return ( ) } diff --git a/app/internal_packages/preferences/lib/tabs/preferences-identity.jsx b/app/internal_packages/preferences/lib/tabs/preferences-identity.jsx index f910d3592..18db5f08f 100644 --- a/app/internal_packages/preferences/lib/tabs/preferences-identity.jsx +++ b/app/internal_packages/preferences/lib/tabs/preferences-identity.jsx @@ -3,6 +3,40 @@ import {Actions, IdentityStore} from 'nylas-exports'; import {OpenIdentityPageButton, BillingModal, RetinaImg} from 'nylas-component-kit'; import {shell} from 'electron'; +class RefreshButton extends React.Component { + constructor(props) { + super(props); + this.state = {refreshing: false}; + } + + componentDidMount() { + this._mounted = true; + } + + componentWillUnmount() { + this._mounted = false; + } + + _onClick = () => { + this.setState({refreshing: true}); + IdentityStore.fetchIdentity().then(() => { + setTimeout(() => { + if (this._mounted) { + this.setState({refreshing: false}); + } + }, 400); + }); + } + + render() { + return ( +
+ +
+ ) + } +} + class PreferencesIdentity extends React.Component { static displayName = 'PreferencesIdentity'; @@ -42,11 +76,15 @@ class PreferencesIdentity extends React.Component { return (
- You are using Mailspring Basic. Upgrade to Mailspring Pro to unlock a more powerful email experience. + You are using Mailspring Basic. You can link up to four email accounts and try out pro features like snooze, send later, read receipts and reminders. Upgrade to Mailspring Pro to unlock a more powerful email experience.
-
Upgrade to Mailspring Pro
-
Learn More
+
+ Upgrade to Mailspring Pro +
+
+ Learn More +
) @@ -81,6 +119,7 @@ class PreferencesIdentity extends React.Component {
+
{firstName} {lastName}
{emailAddress}
diff --git a/app/internal_packages/preferences/styles/preferences-identity.less b/app/internal_packages/preferences/styles/preferences-identity.less index 6b875b184..7a1194be9 100644 --- a/app/internal_packages/preferences/styles/preferences-identity.less +++ b/app/internal_packages/preferences/styles/preferences-identity.less @@ -1,6 +1,6 @@ @import "ui-variables"; -@keyframes spin { 100% { -webkit-transform: rotate(360deg); transform:rotate(360deg); } } +@keyframes spin { 100% { -webkit-transform: rotate(-360deg); transform:rotate(-360deg); } } .container-identity { max-width: 887px; @@ -19,7 +19,7 @@ img { background-color: @text-color-very-subtle; } } .refresh.spinning img { - animation:spin 1.4s linear infinite; + animation: spin 1.4s linear infinite; } .identity-content-box {