diff options
author | 2019-02-21 15:25:45 +0100 | |
---|---|---|
committer | 2019-02-21 15:25:45 +0100 | |
commit | 71e3d7310a06305c3c15685364ea8e20fc720867 (patch) | |
tree | 142ef1cc0ad793ea40cb8ea4f6d5c649cf4e0e3c /src/containers/auth/AuthLayoutContainer.js | |
parent | Add pageview event (diff) | |
download | ferdium-app-71e3d7310a06305c3c15685364ea8e20fc720867.tar.gz ferdium-app-71e3d7310a06305c3c15685364ea8e20fc720867.tar.zst ferdium-app-71e3d7310a06305c3c15685364ea8e20fc720867.zip |
Simplify analytics calls
Diffstat (limited to 'src/containers/auth/AuthLayoutContainer.js')
-rw-r--r-- | src/containers/auth/AuthLayoutContainer.js | 38 |
1 files changed, 24 insertions, 14 deletions
diff --git a/src/containers/auth/AuthLayoutContainer.js b/src/containers/auth/AuthLayoutContainer.js index 762929dc6..e63f40c06 100644 --- a/src/containers/auth/AuthLayoutContainer.js +++ b/src/containers/auth/AuthLayoutContainer.js | |||
@@ -1,6 +1,8 @@ | |||
1 | import React, { Component } from 'react'; | 1 | 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'; | ||
5 | import { theme } from '@meetfranz/theme'; | ||
4 | 6 | ||
5 | import AuthLayout from '../../components/auth/AuthLayout'; | 7 | import AuthLayout from '../../components/auth/AuthLayout'; |
6 | import AppStore from '../../stores/AppStore'; | 8 | import AppStore from '../../stores/AppStore'; |
@@ -21,30 +23,38 @@ export default @inject('stores', 'actions') @observer class AuthLayoutContainer | |||
21 | const { | 23 | const { |
22 | stores, actions, children, location, | 24 | stores, actions, children, location, |
23 | } = this.props; | 25 | } = this.props; |
24 | const { app, features, globalError } = stores; | 26 | const { |
27 | app, features, globalError, settings, | ||
28 | } = stores; | ||
25 | 29 | ||
26 | const isLoadingBaseFeatures = features.defaultFeaturesRequest.isExecuting | 30 | const isLoadingBaseFeatures = features.defaultFeaturesRequest.isExecuting |
27 | && !features.defaultFeaturesRequest.wasExecuted; | 31 | && !features.defaultFeaturesRequest.wasExecuted; |
28 | 32 | ||
33 | const themeType = theme(settings.app.darkMode ? 'dark' : 'default'); | ||
34 | |||
29 | if (isLoadingBaseFeatures) { | 35 | if (isLoadingBaseFeatures) { |
30 | return ( | 36 | return ( |
31 | <AppLoader /> | 37 | <ThemeProvider theme={theme(themeType)}> |
38 | <AppLoader /> | ||
39 | </ThemeProvider> | ||
32 | ); | 40 | ); |
33 | } | 41 | } |
34 | 42 | ||
35 | return ( | 43 | return ( |
36 | <AuthLayout | 44 | <ThemeProvider theme={theme(themeType)}> |
37 | error={globalError.response} | 45 | <AuthLayout |
38 | pathname={location.pathname} | 46 | error={globalError.response} |
39 | isOnline={app.isOnline} | 47 | pathname={location.pathname} |
40 | isAPIHealthy={!app.healthCheckRequest.isError} | 48 | isOnline={app.isOnline} |
41 | retryHealthCheck={actions.app.healthCheck} | 49 | isAPIHealthy={!app.healthCheckRequest.isError} |
42 | isHealthCheckLoading={app.healthCheckRequest.isExecuting} | 50 | retryHealthCheck={actions.app.healthCheck} |
43 | isFullScreen={app.isFullScreen} | 51 | isHealthCheckLoading={app.healthCheckRequest.isExecuting} |
44 | darkMode={app.isSystemDarkModeEnabled} | 52 | isFullScreen={app.isFullScreen} |
45 | > | 53 | darkMode={app.isSystemDarkModeEnabled} |
46 | {children} | 54 | > |
47 | </AuthLayout> | 55 | {children} |
56 | </AuthLayout> | ||
57 | </ThemeProvider> | ||
48 | ); | 58 | ); |
49 | } | 59 | } |
50 | } | 60 | } |