diff options
author | Stefan Malzner <stefan@adlk.io> | 2019-06-28 16:00:16 +0200 |
---|---|---|
committer | Stefan Malzner <stefan@adlk.io> | 2019-06-28 16:00:16 +0200 |
commit | 6fbb243c415e7b2ac17a9e16fe9861e080a76559 (patch) | |
tree | 0c48e6fe861f32434334d2170687a529307fb44d /src/containers | |
parent | Rename feature flags (diff) | |
parent | fix(Notifications): Don't show notification badges when app is muted (diff) | |
download | ferdium-app-6fbb243c415e7b2ac17a9e16fe9861e080a76559.tar.gz ferdium-app-6fbb243c415e7b2ac17a9e16fe9861e080a76559.tar.zst ferdium-app-6fbb243c415e7b2ac17a9e16fe9861e080a76559.zip |
Merge branch 'release/5.2.0-beta.4' into feature/new-pricing
Diffstat (limited to 'src/containers')
-rw-r--r-- | src/containers/auth/AuthLayoutContainer.js | 10 | ||||
-rw-r--r-- | src/containers/layout/AppLayoutContainer.js | 1 | ||||
-rw-r--r-- | src/containers/settings/SettingsWindow.js | 35 |
3 files changed, 29 insertions, 17 deletions
diff --git a/src/containers/auth/AuthLayoutContainer.js b/src/containers/auth/AuthLayoutContainer.js index 1f9c1ea61..427054d3d 100644 --- a/src/containers/auth/AuthLayoutContainer.js +++ b/src/containers/auth/AuthLayoutContainer.js | |||
@@ -2,7 +2,6 @@ import React, { Component } from 'react'; | |||
2 | import PropTypes from 'prop-types'; | 2 | import PropTypes from 'prop-types'; |
3 | import { inject, observer } from 'mobx-react'; | 3 | import { inject, observer } from 'mobx-react'; |
4 | import { ThemeProvider } from 'react-jss'; | 4 | import { ThemeProvider } from 'react-jss'; |
5 | import { theme } from '@meetfranz/theme'; | ||
6 | 5 | ||
7 | import AuthLayout from '../../components/auth/AuthLayout'; | 6 | import AuthLayout from '../../components/auth/AuthLayout'; |
8 | import AppStore from '../../stores/AppStore'; | 7 | import AppStore from '../../stores/AppStore'; |
@@ -24,24 +23,22 @@ export default @inject('stores', 'actions') @observer class AuthLayoutContainer | |||
24 | stores, actions, children, location, | 23 | stores, actions, children, location, |
25 | } = this.props; | 24 | } = this.props; |
26 | const { | 25 | const { |
27 | app, features, globalError, settings, | 26 | app, features, globalError, |
28 | } = stores; | 27 | } = stores; |
29 | 28 | ||
30 | const isLoadingBaseFeatures = features.defaultFeaturesRequest.isExecuting | 29 | const isLoadingBaseFeatures = features.defaultFeaturesRequest.isExecuting |
31 | && !features.defaultFeaturesRequest.wasExecuted; | 30 | && !features.defaultFeaturesRequest.wasExecuted; |
32 | 31 | ||
33 | const themeType = theme(settings.app.darkMode ? 'dark' : 'default'); | ||
34 | |||
35 | if (isLoadingBaseFeatures) { | 32 | if (isLoadingBaseFeatures) { |
36 | return ( | 33 | return ( |
37 | <ThemeProvider theme={theme(themeType)}> | 34 | <ThemeProvider theme={stores.ui.theme}> |
38 | <AppLoader /> | 35 | <AppLoader /> |
39 | </ThemeProvider> | 36 | </ThemeProvider> |
40 | ); | 37 | ); |
41 | } | 38 | } |
42 | 39 | ||
43 | return ( | 40 | return ( |
44 | <ThemeProvider theme={theme(themeType)}> | 41 | <ThemeProvider theme={stores.ui.theme}> |
45 | <AuthLayout | 42 | <AuthLayout |
46 | error={globalError.response} | 43 | error={globalError.response} |
47 | pathname={location.pathname} | 44 | pathname={location.pathname} |
@@ -50,7 +47,6 @@ export default @inject('stores', 'actions') @observer class AuthLayoutContainer | |||
50 | retryHealthCheck={actions.app.healthCheck} | 47 | retryHealthCheck={actions.app.healthCheck} |
51 | isHealthCheckLoading={app.healthCheckRequest.isExecuting} | 48 | isHealthCheckLoading={app.healthCheckRequest.isExecuting} |
52 | isFullScreen={app.isFullScreen} | 49 | isFullScreen={app.isFullScreen} |
53 | darkMode={app.isSystemDarkModeEnabled} | ||
54 | installAppUpdate={actions.app.installUpdate} | 50 | installAppUpdate={actions.app.installUpdate} |
55 | nextAppReleaseVersion={app.nextAppReleaseVersion} | 51 | nextAppReleaseVersion={app.nextAppReleaseVersion} |
56 | appUpdateIsDownloaded={app.updateStatus === app.updateStatusTypes.DOWNLOADED} | 52 | appUpdateIsDownloaded={app.updateStatus === app.updateStatusTypes.DOWNLOADED} |
diff --git a/src/containers/layout/AppLayoutContainer.js b/src/containers/layout/AppLayoutContainer.js index d290a6094..cf3da71e8 100644 --- a/src/containers/layout/AppLayoutContainer.js +++ b/src/containers/layout/AppLayoutContainer.js | |||
@@ -148,7 +148,6 @@ export default @inject('stores', 'actions') @observer class AppLayoutContainer e | |||
148 | areRequiredRequestsSuccessful={requests.areRequiredRequestsSuccessful} | 148 | areRequiredRequestsSuccessful={requests.areRequiredRequestsSuccessful} |
149 | retryRequiredRequests={retryRequiredRequests} | 149 | retryRequiredRequests={retryRequiredRequests} |
150 | areRequiredRequestsLoading={requests.areRequiredRequestsLoading} | 150 | areRequiredRequestsLoading={requests.areRequiredRequestsLoading} |
151 | darkMode={settings.all.app.darkMode} | ||
152 | isDelayAppScreenVisible={delayAppState.isDelayAppScreenVisible} | 151 | isDelayAppScreenVisible={delayAppState.isDelayAppScreenVisible} |
153 | > | 152 | > |
154 | {React.Children.count(children) > 0 ? children : null} | 153 | {React.Children.count(children) > 0 ? children : null} |
diff --git a/src/containers/settings/SettingsWindow.js b/src/containers/settings/SettingsWindow.js index 663b9e2e4..440d32a46 100644 --- a/src/containers/settings/SettingsWindow.js +++ b/src/containers/settings/SettingsWindow.js | |||
@@ -1,4 +1,5 @@ | |||
1 | import React, { Component } from 'react'; | 1 | import React, { Component } from 'react'; |
2 | import ReactDOM from 'react-dom'; | ||
2 | import PropTypes from 'prop-types'; | 3 | import PropTypes from 'prop-types'; |
3 | import { observer, inject } from 'mobx-react'; | 4 | import { observer, inject } from 'mobx-react'; |
4 | 5 | ||
@@ -10,10 +11,23 @@ import ErrorBoundary from '../../components/util/ErrorBoundary'; | |||
10 | import { workspaceStore } from '../../features/workspaces'; | 11 | import { workspaceStore } from '../../features/workspaces'; |
11 | 12 | ||
12 | export default @inject('stores', 'actions') @observer class SettingsContainer extends Component { | 13 | export default @inject('stores', 'actions') @observer class SettingsContainer extends Component { |
14 | portalRoot = document.querySelector('#portalContainer'); | ||
15 | |||
16 | el = document.createElement('div'); | ||
17 | |||
18 | componentDidMount() { | ||
19 | this.portalRoot.appendChild(this.el); | ||
20 | } | ||
21 | |||
22 | componentWillUnmount() { | ||
23 | this.portalRoot.removeChild(this.el); | ||
24 | } | ||
25 | |||
13 | render() { | 26 | render() { |
14 | const { children, stores } = this.props; | 27 | const { children, stores } = this.props; |
15 | const { closeSettings } = this.props.actions.ui; | 28 | const { closeSettings } = this.props.actions.ui; |
16 | 29 | ||
30 | |||
17 | const navigation = ( | 31 | const navigation = ( |
18 | <Navigation | 32 | <Navigation |
19 | serviceCount={stores.services.all.length} | 33 | serviceCount={stores.services.all.length} |
@@ -21,15 +35,18 @@ export default @inject('stores', 'actions') @observer class SettingsContainer ex | |||
21 | /> | 35 | /> |
22 | ); | 36 | ); |
23 | 37 | ||
24 | return ( | 38 | return ReactDOM.createPortal( |
25 | <ErrorBoundary> | 39 | ( |
26 | <Layout | 40 | <ErrorBoundary> |
27 | navigation={navigation} | 41 | <Layout |
28 | closeSettings={closeSettings} | 42 | navigation={navigation} |
29 | > | 43 | closeSettings={closeSettings} |
30 | {children} | 44 | > |
31 | </Layout> | 45 | {children} |
32 | </ErrorBoundary> | 46 | </Layout> |
47 | </ErrorBoundary> | ||
48 | ), | ||
49 | this.el, | ||
33 | ); | 50 | ); |
34 | } | 51 | } |
35 | } | 52 | } |