From 71e3d7310a06305c3c15685364ea8e20fc720867 Mon Sep 17 00:00:00 2001 From: Stefan Malzner Date: Thu, 21 Feb 2019 15:25:45 +0100 Subject: Simplify analytics calls --- src/containers/auth/AuthLayoutContainer.js | 38 +++++++++++++++++++----------- src/containers/auth/ImportScreen.js | 5 ---- src/containers/auth/InviteScreen.js | 5 ---- src/containers/auth/LoginScreen.js | 5 ---- src/containers/auth/PasswordScreen.js | 5 ---- src/containers/auth/PricingScreen.js | 5 ---- src/containers/auth/SignupScreen.js | 5 ---- src/containers/auth/WelcomeScreen.js | 5 ---- 8 files changed, 24 insertions(+), 49 deletions(-) (limited to 'src/containers/auth') 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 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { inject, observer } from 'mobx-react'; +import { ThemeProvider } from 'react-jss'; +import { theme } from '@meetfranz/theme'; import AuthLayout from '../../components/auth/AuthLayout'; import AppStore from '../../stores/AppStore'; @@ -21,30 +23,38 @@ export default @inject('stores', 'actions') @observer class AuthLayoutContainer const { stores, actions, children, location, } = this.props; - const { app, features, globalError } = stores; + const { + app, features, globalError, settings, + } = stores; const isLoadingBaseFeatures = features.defaultFeaturesRequest.isExecuting && !features.defaultFeaturesRequest.wasExecuted; + const themeType = theme(settings.app.darkMode ? 'dark' : 'default'); + if (isLoadingBaseFeatures) { return ( - + + + ); } return ( - - {children} - + + + {children} + + ); } } diff --git a/src/containers/auth/ImportScreen.js b/src/containers/auth/ImportScreen.js index fc46f8b54..4a93891d6 100644 --- a/src/containers/auth/ImportScreen.js +++ b/src/containers/auth/ImportScreen.js @@ -3,13 +3,8 @@ import PropTypes from 'prop-types'; import { inject, observer } from 'mobx-react'; import Import from '../../components/auth/Import'; import UserStore from '../../stores/UserStore'; -import { gaPage } from '../../lib/analytics'; export default @inject('stores', 'actions') @observer class ImportScreen extends Component { - componentDidMount() { - gaPage('Auth/Import'); - } - render() { const { actions, stores } = this.props; diff --git a/src/containers/auth/InviteScreen.js b/src/containers/auth/InviteScreen.js index 26bf97038..66afaf7e1 100644 --- a/src/containers/auth/InviteScreen.js +++ b/src/containers/auth/InviteScreen.js @@ -2,13 +2,8 @@ import React, { Component } from 'react'; import PropTypes from 'prop-types'; import { inject, observer } from 'mobx-react'; import Invite from '../../components/auth/Invite'; -import { gaPage } from '../../lib/analytics'; export default @inject('stores', 'actions') @observer class InviteScreen extends Component { - componentDidMount() { - gaPage('Auth/Invite'); - } - render() { const { actions } = this.props; diff --git a/src/containers/auth/LoginScreen.js b/src/containers/auth/LoginScreen.js index 865bd38f8..e5ee10785 100644 --- a/src/containers/auth/LoginScreen.js +++ b/src/containers/auth/LoginScreen.js @@ -3,7 +3,6 @@ import PropTypes from 'prop-types'; import { inject, observer } from 'mobx-react'; import Login from '../../components/auth/Login'; import UserStore from '../../stores/UserStore'; -import { gaPage } from '../../lib/analytics'; import { globalError as globalErrorPropType } from '../../prop-types'; @@ -12,10 +11,6 @@ export default @inject('stores', 'actions') @observer class LoginScreen extends error: globalErrorPropType.isRequired, }; - componentDidMount() { - gaPage('Auth/Login'); - } - render() { const { actions, stores, error } = this.props; return ( diff --git a/src/containers/auth/PasswordScreen.js b/src/containers/auth/PasswordScreen.js index 236fd2031..5b238860e 100644 --- a/src/containers/auth/PasswordScreen.js +++ b/src/containers/auth/PasswordScreen.js @@ -3,13 +3,8 @@ import PropTypes from 'prop-types'; import { inject, observer } from 'mobx-react'; import Password from '../../components/auth/Password'; import UserStore from '../../stores/UserStore'; -import { gaPage } from '../../lib/analytics'; export default @inject('stores', 'actions') @observer class PasswordScreen extends Component { - componentDidMount() { - gaPage('Auth/Password Retrieve'); - } - render() { const { actions, stores } = this.props; diff --git a/src/containers/auth/PricingScreen.js b/src/containers/auth/PricingScreen.js index 34b512e15..8d179a170 100644 --- a/src/containers/auth/PricingScreen.js +++ b/src/containers/auth/PricingScreen.js @@ -6,7 +6,6 @@ import { RouterStore } from 'mobx-react-router'; import Pricing from '../../components/auth/Pricing'; import UserStore from '../../stores/UserStore'; import PaymentStore from '../../stores/PaymentStore'; -import { gaPage } from '../../lib/analytics'; import { globalError as globalErrorPropType } from '../../prop-types'; @@ -15,10 +14,6 @@ export default @inject('stores', 'actions') @observer class PricingScreen extend error: globalErrorPropType.isRequired, }; - componentDidMount() { - gaPage('Auth/Pricing'); - } - render() { const { actions, stores, error } = this.props; diff --git a/src/containers/auth/SignupScreen.js b/src/containers/auth/SignupScreen.js index caf75de90..efc7ea4c1 100644 --- a/src/containers/auth/SignupScreen.js +++ b/src/containers/auth/SignupScreen.js @@ -4,7 +4,6 @@ import { inject, observer } from 'mobx-react'; import Signup from '../../components/auth/Signup'; import UserStore from '../../stores/UserStore'; -import { gaPage } from '../../lib/analytics'; import { globalError as globalErrorPropType } from '../../prop-types'; @@ -13,10 +12,6 @@ export default @inject('stores', 'actions') @observer class SignupScreen extends error: globalErrorPropType.isRequired, }; - componentDidMount() { - gaPage('Auth/Signup'); - } - render() { const { actions, stores, error } = this.props; return ( diff --git a/src/containers/auth/WelcomeScreen.js b/src/containers/auth/WelcomeScreen.js index 2c120f81c..75182345a 100644 --- a/src/containers/auth/WelcomeScreen.js +++ b/src/containers/auth/WelcomeScreen.js @@ -5,13 +5,8 @@ import { inject, observer } from 'mobx-react'; import Welcome from '../../components/auth/Welcome'; import UserStore from '../../stores/UserStore'; import RecipePreviewsStore from '../../stores/RecipePreviewsStore'; -import { gaPage } from '../../lib/analytics'; export default @inject('stores', 'actions') @observer class LoginScreen extends Component { - componentDidMount() { - gaPage('Auth/Welcome'); - } - render() { const { user, recipePreviews } = this.props.stores; -- cgit v1.2.3-54-g00ecf