aboutsummaryrefslogtreecommitdiffstats
path: root/src/features/todos
diff options
context:
space:
mode:
authorLibravatar Dominik Guzei <dominik.guzei@gmail.com>2019-09-05 14:34:13 +0200
committerLibravatar Dominik Guzei <dominik.guzei@gmail.com>2019-09-05 14:34:13 +0200
commit5336eab8b279eea886d8ce6efb03bd771d65ddc8 (patch)
tree79ebdf1a60ed0f2f1c8de93c90e90d7d2f5dab47 /src/features/todos
parentMerge branch 'feature/todos' into develop (diff)
parentFix headline spacing (diff)
downloadferdium-app-5336eab8b279eea886d8ce6efb03bd771d65ddc8.tar.gz
ferdium-app-5336eab8b279eea886d8ce6efb03bd771d65ddc8.tar.zst
ferdium-app-5336eab8b279eea886d8ce6efb03bd771d65ddc8.zip
Merge branch 'develop' of https://github.com/meetfranz/franz into develop
Diffstat (limited to 'src/features/todos')
-rw-r--r--src/features/todos/components/TodosWebview.js12
-rw-r--r--src/features/todos/store.js20
2 files changed, 24 insertions, 8 deletions
diff --git a/src/features/todos/components/TodosWebview.js b/src/features/todos/components/TodosWebview.js
index 143955a7b..c06183e37 100644
--- a/src/features/todos/components/TodosWebview.js
+++ b/src/features/todos/components/TodosWebview.js
@@ -9,7 +9,7 @@ import { defineMessages, intlShape } from 'react-intl';
9import { mdiChevronRight, mdiCheckAll } from '@mdi/js'; 9import { mdiChevronRight, mdiCheckAll } from '@mdi/js';
10import * as environment from '../../../environment'; 10import * as environment from '../../../environment';
11import Appear from '../../../components/ui/effects/Appear'; 11import Appear from '../../../components/ui/effects/Appear';
12import ActivateTrialButton from '../../../components/ui/ActivateTrialButton'; 12import UpgradeButton from '../../../components/ui/UpgradeButton';
13 13
14const OPEN_TODOS_BUTTON_SIZE = 45; 14const OPEN_TODOS_BUTTON_SIZE = 45;
15const CLOSE_TODOS_BUTTON_SIZE = 35; 15const CLOSE_TODOS_BUTTON_SIZE = 35;
@@ -17,7 +17,7 @@ const CLOSE_TODOS_BUTTON_SIZE = 35;
17const messages = defineMessages({ 17const messages = defineMessages({
18 premiumInfo: { 18 premiumInfo: {
19 id: 'feature.todos.premium.info', 19 id: 'feature.todos.premium.info',
20 defaultMessage: '!!!The Franz Todos Preview is currently only available for Franz Premium accounts.', 20 defaultMessage: '!!!Franz Todos are available to premium users now!',
21 }, 21 },
22 upgradeCTA: { 22 upgradeCTA: {
23 id: 'feature.todos.premium.upgrade', 23 id: 'feature.todos.premium.upgrade',
@@ -25,7 +25,7 @@ const messages = defineMessages({
25 }, 25 },
26 rolloutInfo: { 26 rolloutInfo: {
27 id: 'feature.todos.premium.rollout', 27 id: 'feature.todos.premium.rollout',
28 defaultMessage: '!!!Franz Todos will be available to everyone soon.', 28 defaultMessage: '!!!Everyone else will have to wait a little longer.',
29 }, 29 },
30}); 30});
31 31
@@ -112,7 +112,7 @@ const styles = theme => ({
112 alignItems: 'center', 112 alignItems: 'center',
113 width: '80%', 113 width: '80%',
114 maxWidth: 300, 114 maxWidth: 300,
115 margin: [-50, 'auto', 0], 115 margin: [0, 'auto'],
116 textAlign: 'center', 116 textAlign: 'center',
117 }, 117 },
118 premiumIcon: { 118 premiumIcon: {
@@ -281,10 +281,10 @@ class TodosWebview extends Component {
281 ) : ( 281 ) : (
282 <Appear> 282 <Appear>
283 <div className={classes.premiumContainer}> 283 <div className={classes.premiumContainer}>
284 <Icon icon={mdiCheckAll} className={classes.premiumIcon} size={5} /> 284 <Icon icon={mdiCheckAll} className={classes.premiumIcon} size={4} />
285 <p>{intl.formatMessage(messages.premiumInfo)}</p> 285 <p>{intl.formatMessage(messages.premiumInfo)}</p>
286 <p>{intl.formatMessage(messages.rolloutInfo)}</p> 286 <p>{intl.formatMessage(messages.rolloutInfo)}</p>
287 <ActivateTrialButton 287 <UpgradeButton
288 className={classes.premiumCTA} 288 className={classes.premiumCTA}
289 gaEventInfo={{ category: 'Todos', event: 'upgrade' }} 289 gaEventInfo={{ category: 'Todos', event: 'upgrade' }}
290 short 290 short
diff --git a/src/features/todos/store.js b/src/features/todos/store.js
index 170408ebb..aebe0dcbe 100644
--- a/src/features/todos/store.js
+++ b/src/features/todos/store.js
@@ -30,7 +30,7 @@ export default class TodoStore extends FeatureStore {
30 } 30 }
31 31
32 @computed get isTodosPanelVisible() { 32 @computed get isTodosPanelVisible() {
33 if (this.stores.services.all.length === 0 || delayAppState.isDelayAppScreenVisible) return false; 33 if (delayAppState.isDelayAppScreenVisible) return false;
34 if (this.settings.isTodosPanelVisible === undefined) return DEFAULT_TODOS_VISIBLE; 34 if (this.settings.isTodosPanelVisible === undefined) return DEFAULT_TODOS_VISIBLE;
35 35
36 return this.settings.isTodosPanelVisible; 36 return this.settings.isTodosPanelVisible;
@@ -62,6 +62,7 @@ export default class TodoStore extends FeatureStore {
62 this._allReactions = createReactions([ 62 this._allReactions = createReactions([
63 this._setFeatureEnabledReaction, 63 this._setFeatureEnabledReaction,
64 this._updateTodosConfig, 64 this._updateTodosConfig,
65 this._firstLaunchReaction,
65 ]); 66 ]);
66 67
67 this._registerReactions(this._allReactions); 68 this._registerReactions(this._allReactions);
@@ -156,5 +157,20 @@ export default class TodoStore extends FeatureStore {
156 _updateTodosConfig = () => { 157 _updateTodosConfig = () => {
157 // Resend the config if any part changes in Franz: 158 // Resend the config if any part changes in Franz:
158 this._onTodosClientInitialized(); 159 this._onTodosClientInitialized();
159 } 160 };
161
162 _firstLaunchReaction = () => {
163 const { stats } = this.stores.settings.all;
164
165 // Hide todos layer on first app start but show on second
166 if (stats.appStarts <= 1) {
167 this._updateSettings({
168 isTodosPanelVisible: false,
169 });
170 } else if (stats.appStarts <= 2) {
171 this._updateSettings({
172 isTodosPanelVisible: true,
173 });
174 }
175 };
160} 176}