diff options
author | 2018-11-24 20:15:39 +0100 | |
---|---|---|
committer | 2018-11-24 20:15:39 +0100 | |
commit | 4ea044ae6b2e27e48d45bc3be1c366f4882bbda5 (patch) | |
tree | d19064b7370cb66ef66407de082bedad4c3128d4 /src/stores | |
parent | disable import/prefer-default-export (diff) | |
download | ferdium-app-4ea044ae6b2e27e48d45bc3be1c366f4882bbda5.tar.gz ferdium-app-4ea044ae6b2e27e48d45bc3be1c366f4882bbda5.tar.zst ferdium-app-4ea044ae6b2e27e48d45bc3be1c366f4882bbda5.zip |
feat(App): Lay groundwork for general themeing support
Diffstat (limited to 'src/stores')
-rw-r--r-- | src/stores/UIStore.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/stores/UIStore.js b/src/stores/UIStore.js index bee6c8bcf..d37ebe4c7 100644 --- a/src/stores/UIStore.js +++ b/src/stores/UIStore.js | |||
@@ -1,6 +1,8 @@ | |||
1 | import { action, observable, computed } from 'mobx'; | 1 | import { action, observable, computed } from 'mobx'; |
2 | 2 | ||
3 | import Store from './lib/Store'; | 3 | import Store from './lib/Store'; |
4 | import * as themeDefault from '../theme/default'; | ||
5 | import * as themeDark from '../theme/dark'; | ||
4 | 6 | ||
5 | export default class UIStore extends Store { | 7 | export default class UIStore extends Store { |
6 | @observable showServicesUpdatedInfoBar = false; | 8 | @observable showServicesUpdatedInfoBar = false; |
@@ -20,6 +22,14 @@ export default class UIStore extends Store { | |||
20 | return (settings.app.isAppMuted && settings.app.showMessageBadgeWhenMuted) || !settings.isAppMuted; | 22 | return (settings.app.isAppMuted && settings.app.showMessageBadgeWhenMuted) || !settings.isAppMuted; |
21 | } | 23 | } |
22 | 24 | ||
25 | @computed get theme() { | ||
26 | if (this.stores.settings.all.app.darkMode) { | ||
27 | return Object.assign({}, themeDefault, themeDark); | ||
28 | } | ||
29 | |||
30 | return themeDefault; | ||
31 | } | ||
32 | |||
23 | // Actions | 33 | // Actions |
24 | @action _openSettings({ path = '/settings' }) { | 34 | @action _openSettings({ path = '/settings' }) { |
25 | const settingsPath = path !== '/settings' ? `/settings/${path}` : path; | 35 | const settingsPath = path !== '/settings' ? `/settings/${path}` : path; |