diff options
author | 2019-09-05 09:49:25 +0200 | |
---|---|---|
committer | 2019-09-05 09:49:25 +0200 | |
commit | 24d0223fee38c36ec19d9c662579dba7d787f8b4 (patch) | |
tree | 17a50e725cef1266506fc9ac6352c15a120cba78 /src/features/todos | |
parent | don't warn on react/destructuring-assignment (diff) | |
download | ferdium-app-24d0223fee38c36ec19d9c662579dba7d787f8b4.tar.gz ferdium-app-24d0223fee38c36ec19d9c662579dba7d787f8b4.tar.zst ferdium-app-24d0223fee38c36ec19d9c662579dba7d787f8b4.zip |
polishing
Diffstat (limited to 'src/features/todos')
-rw-r--r-- | src/features/todos/components/TodosWebview.js | 8 | ||||
-rw-r--r-- | src/features/todos/store.js | 18 |
2 files changed, 21 insertions, 5 deletions
diff --git a/src/features/todos/components/TodosWebview.js b/src/features/todos/components/TodosWebview.js index 9a50f7e8d..fa530daed 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'; | |||
9 | import { mdiChevronRight, mdiCheckAll } from '@mdi/js'; | 9 | import { mdiChevronRight, mdiCheckAll } from '@mdi/js'; |
10 | import * as environment from '../../../environment'; | 10 | import * as environment from '../../../environment'; |
11 | import Appear from '../../../components/ui/effects/Appear'; | 11 | import Appear from '../../../components/ui/effects/Appear'; |
12 | import ActivateTrialButton from '../../../components/ui/ActivateTrialButton'; | 12 | import UpgradeButton from '../../../components/ui/UpgradeButton'; |
13 | 13 | ||
14 | const OPEN_TODOS_BUTTON_SIZE = 45; | 14 | const OPEN_TODOS_BUTTON_SIZE = 45; |
15 | const CLOSE_TODOS_BUTTON_SIZE = 35; | 15 | const CLOSE_TODOS_BUTTON_SIZE = 35; |
@@ -116,7 +116,7 @@ const styles = theme => ({ | |||
116 | alignItems: 'center', | 116 | alignItems: 'center', |
117 | width: '80%', | 117 | width: '80%', |
118 | maxWidth: 300, | 118 | maxWidth: 300, |
119 | margin: [-50, 'auto', 0], | 119 | margin: [0, 'auto'], |
120 | textAlign: 'center', | 120 | textAlign: 'center', |
121 | }, | 121 | }, |
122 | premiumIcon: { | 122 | premiumIcon: { |
@@ -286,10 +286,10 @@ class TodosWebview extends Component { | |||
286 | ) : ( | 286 | ) : ( |
287 | <Appear> | 287 | <Appear> |
288 | <div className={classes.premiumContainer}> | 288 | <div className={classes.premiumContainer}> |
289 | <Icon icon={mdiCheckAll} className={classes.premiumIcon} size={5} /> | 289 | <Icon icon={mdiCheckAll} className={classes.premiumIcon} size={4} /> |
290 | <p>{intl.formatMessage(messages.premiumInfo)}</p> | 290 | <p>{intl.formatMessage(messages.premiumInfo)}</p> |
291 | <p>{intl.formatMessage(messages.rolloutInfo)}</p> | 291 | <p>{intl.formatMessage(messages.rolloutInfo)}</p> |
292 | <ActivateTrialButton | 292 | <UpgradeButton |
293 | className={classes.premiumCTA} | 293 | className={classes.premiumCTA} |
294 | gaEventInfo={{ category: 'Todos', event: 'upgrade' }} | 294 | gaEventInfo={{ category: 'Todos', event: 'upgrade' }} |
295 | short | 295 | short |
diff --git a/src/features/todos/store.js b/src/features/todos/store.js index 56e117c6c..5c6abff4c 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; |
@@ -61,6 +61,7 @@ export default class TodoStore extends FeatureStore { | |||
61 | 61 | ||
62 | this._allReactions = createReactions([ | 62 | this._allReactions = createReactions([ |
63 | this._setFeatureEnabledReaction, | 63 | this._setFeatureEnabledReaction, |
64 | this._firstLaunchReaction, | ||
64 | ]); | 65 | ]); |
65 | 66 | ||
66 | this._registerReactions(this._allReactions); | 67 | this._registerReactions(this._allReactions); |
@@ -146,4 +147,19 @@ export default class TodoStore extends FeatureStore { | |||
146 | 147 | ||
147 | this.isFeatureEnabled = isTodosEnabled; | 148 | this.isFeatureEnabled = isTodosEnabled; |
148 | }; | 149 | }; |
150 | |||
151 | _firstLaunchReaction = () => { | ||
152 | const { stats } = this.stores.settings.all; | ||
153 | |||
154 | // Hide todos layer on first app start but show on second | ||
155 | if (stats.appStarts <= 1) { | ||
156 | this._updateSettings({ | ||
157 | isTodosPanelVisible: false, | ||
158 | }); | ||
159 | } else if (stats.appStarts <= 2) { | ||
160 | this._updateSettings({ | ||
161 | isTodosPanelVisible: true, | ||
162 | }); | ||
163 | } | ||
164 | }; | ||
149 | } | 165 | } |