aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Dominik Guzei <dominik.guzei@gmail.com>2019-02-22 17:15:22 +0100
committerLibravatar Dominik Guzei <dominik.guzei@gmail.com>2019-02-22 17:15:22 +0100
commitbba95118076e1185c05605bdf58fabac3de82f17 (patch)
tree190f88e47e91763bc5702b5bbc55a04744043358
parentpin gulp-sass-variables version to 1.1.1 (diff)
parentremove code (diff)
downloadferdium-app-bba95118076e1185c05605bdf58fabac3de82f17.tar.gz
ferdium-app-bba95118076e1185c05605bdf58fabac3de82f17.tar.zst
ferdium-app-bba95118076e1185c05605bdf58fabac3de82f17.zip
merge-in latest develop
-rw-r--r--package-lock.json18
-rw-r--r--packages/forms/src/input/index.tsx6
-rw-r--r--packages/theme/src/themes/dark/index.ts3
-rw-r--r--packages/theme/src/themes/default/index.ts3
-rw-r--r--src/config.js4
-rw-r--r--src/containers/auth/AuthLayoutContainer.js38
-rw-r--r--src/containers/auth/ImportScreen.js5
-rw-r--r--src/containers/auth/InviteScreen.js5
-rw-r--r--src/containers/auth/LoginScreen.js5
-rw-r--r--src/containers/auth/PasswordScreen.js5
-rw-r--r--src/containers/auth/PricingScreen.js5
-rw-r--r--src/containers/auth/SignupScreen.js5
-rw-r--r--src/containers/auth/WelcomeScreen.js5
-rw-r--r--src/containers/settings/AccountScreen.js5
-rw-r--r--src/containers/settings/EditServiceScreen.js5
-rw-r--r--src/containers/settings/EditSettingsScreen.js5
-rw-r--r--src/containers/settings/EditUserScreen.js5
-rw-r--r--src/containers/settings/InviteScreen.js6
-rw-r--r--src/containers/settings/RecipesScreen.js6
-rw-r--r--src/containers/settings/ServicesScreen.js5
-rw-r--r--src/features/basicAuth/index.js9
-rw-r--r--src/features/delayApp/index.js3
-rw-r--r--src/stores/AppStore.js12
-rw-r--r--src/theme/dark/index.js19
-rw-r--r--src/theme/default/index.js35
25 files changed, 69 insertions, 153 deletions
diff --git a/package-lock.json b/package-lock.json
index f34f0bef9..05ad8f465 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1948,6 +1948,15 @@
1948 "@meetfranz/theme": "^1.0.7", 1948 "@meetfranz/theme": "^1.0.7",
1949 "react-html-attributes": "^1.4.3", 1949 "react-html-attributes": "^1.4.3",
1950 "react-loader": "^2.4.5" 1950 "react-loader": "^2.4.5"
1951 },
1952 "dependencies": {
1953 "@meetfranz/theme": {
1954 "version": "1.0.9",
1955 "bundled": true,
1956 "requires": {
1957 "color": "^3.1.0"
1958 }
1959 }
1951 } 1960 }
1952 }, 1961 },
1953 "@meetfranz/theme": { 1962 "@meetfranz/theme": {
@@ -1963,6 +1972,15 @@
1963 "@mdi/react": "^1.1.0", 1972 "@mdi/react": "^1.1.0",
1964 "@meetfranz/theme": "^1.0.7", 1973 "@meetfranz/theme": "^1.0.7",
1965 "react-loader": "^2.4.5" 1974 "react-loader": "^2.4.5"
1975 },
1976 "dependencies": {
1977 "@meetfranz/theme": {
1978 "version": "1.0.9",
1979 "bundled": true,
1980 "requires": {
1981 "color": "^3.1.0"
1982 }
1983 }
1966 } 1984 }
1967 }, 1985 },
1968 "@mrmlnc/readdir-enhanced": { 1986 "@mrmlnc/readdir-enhanced": {
diff --git a/packages/forms/src/input/index.tsx b/packages/forms/src/input/index.tsx
index 791e0f360..68bb5ac57 100644
--- a/packages/forms/src/input/index.tsx
+++ b/packages/forms/src/input/index.tsx
@@ -38,6 +38,7 @@ class InputComponent extends Component<IProps, IState> {
38 focus: false, 38 focus: false,
39 onChange: () => {}, 39 onChange: () => {},
40 onBlur: () => {}, 40 onBlur: () => {},
41 onFocus: () => {},
41 scorePassword: false, 42 scorePassword: false,
42 showLabel: true, 43 showLabel: true,
43 showPasswordToggle: false, 44 showPasswordToggle: false,
@@ -108,7 +109,11 @@ class InputComponent extends Component<IProps, IState> {
108 placeholder, 109 placeholder,
109 spellCheck, 110 spellCheck,
110 onBlur, 111 onBlur,
112<<<<<<< HEAD
111 onEnterKey, 113 onEnterKey,
114=======
115 onFocus,
116>>>>>>> develop
112 } = this.props; 117 } = this.props;
113 118
114 const { 119 const {
@@ -151,6 +156,7 @@ class InputComponent extends Component<IProps, IState> {
151 className={classes.input} 156 className={classes.input}
152 ref={this.inputRef} 157 ref={this.inputRef}
153 onChange={this.onChange.bind(this)} 158 onChange={this.onChange.bind(this)}
159 onFocus={onFocus}
154 onBlur={onBlur} 160 onBlur={onBlur}
155 disabled={disabled} 161 disabled={disabled}
156 onKeyPress={this.onInputKeyPress.bind(this)} 162 onKeyPress={this.onInputKeyPress.bind(this)}
diff --git a/packages/theme/src/themes/dark/index.ts b/packages/theme/src/themes/dark/index.ts
index 9b6bf055c..1757f5abd 100644
--- a/packages/theme/src/themes/dark/index.ts
+++ b/packages/theme/src/themes/dark/index.ts
@@ -60,3 +60,6 @@ export const selectOptionBorder = `1px solid ${color(legacyStyles.darkThemeGrayL
60export const selectOptionItemHover = color(legacyStyles.darkThemeGrayLight).darken(0.2).hex(); 60export const selectOptionItemHover = color(legacyStyles.darkThemeGrayLight).darken(0.2).hex();
61export const selectOptionItemHoverColor = selectColor; 61export const selectOptionItemHoverColor = selectColor;
62export const selectSearchColor = inputBackground; 62export const selectSearchColor = inputBackground;
63
64// Modal
65export const colorModalOverlayBackground = color(legacyStyles.darkThemeGray).alpha(0.8).rgb().string();
diff --git a/packages/theme/src/themes/default/index.ts b/packages/theme/src/themes/default/index.ts
index d36558ff0..40521995b 100644
--- a/packages/theme/src/themes/default/index.ts
+++ b/packages/theme/src/themes/default/index.ts
@@ -137,3 +137,6 @@ export const selectDisabledOpacity = inputDisabledOpacity;
137// Badge 137// Badge
138export const badgeFontSize = uiFontSize - 2; 138export const badgeFontSize = uiFontSize - 2;
139export const badgeBorderRadius = 50; 139export const badgeBorderRadius = 50;
140
141// Modal
142export const colorModalOverlayBackground = color(legacyStyles.themeGrayLighter).alpha(0.8).rgb().string();
diff --git a/src/config.js b/src/config.js
index 3696354c6..b11952520 100644
--- a/src/config.js
+++ b/src/config.js
@@ -1,5 +1,7 @@
1import electron from 'electron'; 1import electron from 'electron';
2import path from 'path'; 2import path from 'path';
3import isDevMode from 'electron-is-dev';
4
3import { asarPath } from './helpers/asar-helpers'; 5import { asarPath } from './helpers/asar-helpers';
4 6
5const app = process.type === 'renderer' ? electron.remote.app : electron.app; 7const app = process.type === 'renderer' ? electron.remote.app : electron.app;
@@ -9,7 +11,7 @@ export const CHECK_INTERVAL = 1000 * 3600; // How often should we perform checks
9export const LOCAL_API = 'http://localhost:3000'; 11export const LOCAL_API = 'http://localhost:3000';
10export const DEV_API = 'https://dev.franzinfra.com'; 12export const DEV_API = 'https://dev.franzinfra.com';
11export const LIVE_API = 'https://api.franzinfra.com'; 13export const LIVE_API = 'https://api.franzinfra.com';
12export const GA_ID = 'UA-74126766-10'; 14export const GA_ID = !isDevMode ? 'UA-74126766-10' : 'UA-74126766-12';
13 15
14export const DEFAULT_APP_SETTINGS = { 16export const DEFAULT_APP_SETTINGS = {
15 autoLaunchInBackground: false, 17 autoLaunchInBackground: false,
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 @@
1import React, { Component } from 'react'; 1import React, { Component } from 'react';
2import PropTypes from 'prop-types'; 2import PropTypes from 'prop-types';
3import { inject, observer } from 'mobx-react'; 3import { inject, observer } from 'mobx-react';
4import { ThemeProvider } from 'react-jss';
5import { theme } from '@meetfranz/theme';
4 6
5import AuthLayout from '../../components/auth/AuthLayout'; 7import AuthLayout from '../../components/auth/AuthLayout';
6import AppStore from '../../stores/AppStore'; 8import 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}
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';
3import { inject, observer } from 'mobx-react'; 3import { inject, observer } from 'mobx-react';
4import Import from '../../components/auth/Import'; 4import Import from '../../components/auth/Import';
5import UserStore from '../../stores/UserStore'; 5import UserStore from '../../stores/UserStore';
6import { gaPage } from '../../lib/analytics';
7 6
8export default @inject('stores', 'actions') @observer class ImportScreen extends Component { 7export default @inject('stores', 'actions') @observer class ImportScreen extends Component {
9 componentDidMount() {
10 gaPage('Auth/Import');
11 }
12
13 render() { 8 render() {
14 const { actions, stores } = this.props; 9 const { actions, stores } = this.props;
15 10
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';
2import PropTypes from 'prop-types'; 2import PropTypes from 'prop-types';
3import { inject, observer } from 'mobx-react'; 3import { inject, observer } from 'mobx-react';
4import Invite from '../../components/auth/Invite'; 4import Invite from '../../components/auth/Invite';
5import { gaPage } from '../../lib/analytics';
6 5
7export default @inject('stores', 'actions') @observer class InviteScreen extends Component { 6export default @inject('stores', 'actions') @observer class InviteScreen extends Component {
8 componentDidMount() {
9 gaPage('Auth/Invite');
10 }
11
12 render() { 7 render() {
13 const { actions } = this.props; 8 const { actions } = this.props;
14 9
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';
3import { inject, observer } from 'mobx-react'; 3import { inject, observer } from 'mobx-react';
4import Login from '../../components/auth/Login'; 4import Login from '../../components/auth/Login';
5import UserStore from '../../stores/UserStore'; 5import UserStore from '../../stores/UserStore';
6import { gaPage } from '../../lib/analytics';
7 6
8import { globalError as globalErrorPropType } from '../../prop-types'; 7import { globalError as globalErrorPropType } from '../../prop-types';
9 8
@@ -12,10 +11,6 @@ export default @inject('stores', 'actions') @observer class LoginScreen extends
12 error: globalErrorPropType.isRequired, 11 error: globalErrorPropType.isRequired,
13 }; 12 };
14 13
15 componentDidMount() {
16 gaPage('Auth/Login');
17 }
18
19 render() { 14 render() {
20 const { actions, stores, error } = this.props; 15 const { actions, stores, error } = this.props;
21 return ( 16 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';
3import { inject, observer } from 'mobx-react'; 3import { inject, observer } from 'mobx-react';
4import Password from '../../components/auth/Password'; 4import Password from '../../components/auth/Password';
5import UserStore from '../../stores/UserStore'; 5import UserStore from '../../stores/UserStore';
6import { gaPage } from '../../lib/analytics';
7 6
8export default @inject('stores', 'actions') @observer class PasswordScreen extends Component { 7export default @inject('stores', 'actions') @observer class PasswordScreen extends Component {
9 componentDidMount() {
10 gaPage('Auth/Password Retrieve');
11 }
12
13 render() { 8 render() {
14 const { actions, stores } = this.props; 9 const { actions, stores } = this.props;
15 10
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';
6import Pricing from '../../components/auth/Pricing'; 6import Pricing from '../../components/auth/Pricing';
7import UserStore from '../../stores/UserStore'; 7import UserStore from '../../stores/UserStore';
8import PaymentStore from '../../stores/PaymentStore'; 8import PaymentStore from '../../stores/PaymentStore';
9import { gaPage } from '../../lib/analytics';
10 9
11import { globalError as globalErrorPropType } from '../../prop-types'; 10import { globalError as globalErrorPropType } from '../../prop-types';
12 11
@@ -15,10 +14,6 @@ export default @inject('stores', 'actions') @observer class PricingScreen extend
15 error: globalErrorPropType.isRequired, 14 error: globalErrorPropType.isRequired,
16 }; 15 };
17 16
18 componentDidMount() {
19 gaPage('Auth/Pricing');
20 }
21
22 render() { 17 render() {
23 const { actions, stores, error } = this.props; 18 const { actions, stores, error } = this.props;
24 19
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';
4 4
5import Signup from '../../components/auth/Signup'; 5import Signup from '../../components/auth/Signup';
6import UserStore from '../../stores/UserStore'; 6import UserStore from '../../stores/UserStore';
7import { gaPage } from '../../lib/analytics';
8 7
9import { globalError as globalErrorPropType } from '../../prop-types'; 8import { globalError as globalErrorPropType } from '../../prop-types';
10 9
@@ -13,10 +12,6 @@ export default @inject('stores', 'actions') @observer class SignupScreen extends
13 error: globalErrorPropType.isRequired, 12 error: globalErrorPropType.isRequired,
14 }; 13 };
15 14
16 componentDidMount() {
17 gaPage('Auth/Signup');
18 }
19
20 render() { 15 render() {
21 const { actions, stores, error } = this.props; 16 const { actions, stores, error } = this.props;
22 return ( 17 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';
5import Welcome from '../../components/auth/Welcome'; 5import Welcome from '../../components/auth/Welcome';
6import UserStore from '../../stores/UserStore'; 6import UserStore from '../../stores/UserStore';
7import RecipePreviewsStore from '../../stores/RecipePreviewsStore'; 7import RecipePreviewsStore from '../../stores/RecipePreviewsStore';
8import { gaPage } from '../../lib/analytics';
9 8
10export default @inject('stores', 'actions') @observer class LoginScreen extends Component { 9export default @inject('stores', 'actions') @observer class LoginScreen extends Component {
11 componentDidMount() {
12 gaPage('Auth/Welcome');
13 }
14
15 render() { 10 render() {
16 const { user, recipePreviews } = this.props.stores; 11 const { user, recipePreviews } = this.props.stores;
17 12
diff --git a/src/containers/settings/AccountScreen.js b/src/containers/settings/AccountScreen.js
index d681d5226..ce1b9c333 100644
--- a/src/containers/settings/AccountScreen.js
+++ b/src/containers/settings/AccountScreen.js
@@ -6,7 +6,6 @@ import { inject, observer } from 'mobx-react';
6import PaymentStore from '../../stores/PaymentStore'; 6import PaymentStore from '../../stores/PaymentStore';
7import UserStore from '../../stores/UserStore'; 7import UserStore from '../../stores/UserStore';
8import AppStore from '../../stores/AppStore'; 8import AppStore from '../../stores/AppStore';
9import { gaPage } from '../../lib/analytics';
10 9
11import AccountDashboard from '../../components/settings/account/AccountDashboard'; 10import AccountDashboard from '../../components/settings/account/AccountDashboard';
12import ErrorBoundary from '../../components/util/ErrorBoundary'; 11import ErrorBoundary from '../../components/util/ErrorBoundary';
@@ -22,10 +21,6 @@ export default @inject('stores', 'actions') @observer class AccountScreen extend
22 user.getUserInfoRequest.invalidate({ immediately: true }); 21 user.getUserInfoRequest.invalidate({ immediately: true });
23 } 22 }
24 23
25 componentDidMount() {
26 gaPage('Settings/Account Dashboard');
27 }
28
29 onCloseWindow() { 24 onCloseWindow() {
30 const { user, payment } = this.props.stores; 25 const { user, payment } = this.props.stores;
31 user.getUserInfoRequest.invalidate({ immediately: true }); 26 user.getUserInfoRequest.invalidate({ immediately: true });
diff --git a/src/containers/settings/EditServiceScreen.js b/src/containers/settings/EditServiceScreen.js
index d08f0a52e..870ca4ecd 100644
--- a/src/containers/settings/EditServiceScreen.js
+++ b/src/containers/settings/EditServiceScreen.js
@@ -9,7 +9,6 @@ import ServicesStore from '../../stores/ServicesStore';
9import SettingsStore from '../../stores/SettingsStore'; 9import SettingsStore from '../../stores/SettingsStore';
10import FeaturesStore from '../../stores/FeaturesStore'; 10import FeaturesStore from '../../stores/FeaturesStore';
11import Form from '../../lib/Form'; 11import Form from '../../lib/Form';
12import { gaPage } from '../../lib/analytics';
13 12
14import ServiceError from '../../components/settings/services/ServiceError'; 13import ServiceError from '../../components/settings/services/ServiceError';
15import EditServiceForm from '../../components/settings/services/EditServiceForm'; 14import EditServiceForm from '../../components/settings/services/EditServiceForm';
@@ -93,10 +92,6 @@ export default @inject('stores', 'actions') @observer class EditServiceScreen ex
93 intl: intlShape, 92 intl: intlShape,
94 }; 93 };
95 94
96 componentDidMount() {
97 gaPage('Settings/Service/Edit');
98 }
99
100 onSubmit(data) { 95 onSubmit(data) {
101 const { action } = this.props.router.params; 96 const { action } = this.props.router.params;
102 const { recipes, services } = this.props.stores; 97 const { recipes, services } = this.props.stores;
diff --git a/src/containers/settings/EditSettingsScreen.js b/src/containers/settings/EditSettingsScreen.js
index 992c49b09..97c1fa3b1 100644
--- a/src/containers/settings/EditSettingsScreen.js
+++ b/src/containers/settings/EditSettingsScreen.js
@@ -8,7 +8,6 @@ import SettingsStore from '../../stores/SettingsStore';
8import UserStore from '../../stores/UserStore'; 8import UserStore from '../../stores/UserStore';
9import Form from '../../lib/Form'; 9import Form from '../../lib/Form';
10import { APP_LOCALES, SPELLCHECKER_LOCALES } from '../../i18n/languages'; 10import { APP_LOCALES, SPELLCHECKER_LOCALES } from '../../i18n/languages';
11import { gaPage } from '../../lib/analytics';
12import { DEFAULT_APP_SETTINGS } from '../../config'; 11import { DEFAULT_APP_SETTINGS } from '../../config';
13import { config as spellcheckerConfig } from '../../features/spellchecker'; 12import { config as spellcheckerConfig } from '../../features/spellchecker';
14 13
@@ -75,10 +74,6 @@ export default @inject('stores', 'actions') @observer class EditSettingsScreen e
75 intl: intlShape, 74 intl: intlShape,
76 }; 75 };
77 76
78 componentDidMount() {
79 gaPage('Settings/App');
80 }
81
82 onSubmit(settingsData) { 77 onSubmit(settingsData) {
83 const { app, settings, user } = this.props.actions; 78 const { app, settings, user } = this.props.actions;
84 79
diff --git a/src/containers/settings/EditUserScreen.js b/src/containers/settings/EditUserScreen.js
index 3d35effc5..bade928a0 100644
--- a/src/containers/settings/EditUserScreen.js
+++ b/src/containers/settings/EditUserScreen.js
@@ -9,7 +9,6 @@ import EditUserForm from '../../components/settings/user/EditUserForm';
9import ErrorBoundary from '../../components/util/ErrorBoundary'; 9import ErrorBoundary from '../../components/util/ErrorBoundary';
10 10
11import { required, email, minLength } from '../../helpers/validation-helpers'; 11import { required, email, minLength } from '../../helpers/validation-helpers';
12import { gaPage } from '../../lib/analytics';
13 12
14const messages = defineMessages({ 13const messages = defineMessages({
15 firstname: { 14 firstname: {
@@ -57,10 +56,6 @@ export default @inject('stores', 'actions') @observer class EditUserScreen exten
57 intl: intlShape, 56 intl: intlShape,
58 }; 57 };
59 58
60 componentDidMount() {
61 gaPage('Settings/Account/Edit');
62 }
63
64 componentWillUnmount() { 59 componentWillUnmount() {
65 this.props.actions.user.resetStatus(); 60 this.props.actions.user.resetStatus();
66 } 61 }
diff --git a/src/containers/settings/InviteScreen.js b/src/containers/settings/InviteScreen.js
index cd36610e4..cc36849e8 100644
--- a/src/containers/settings/InviteScreen.js
+++ b/src/containers/settings/InviteScreen.js
@@ -5,13 +5,7 @@ import { inject, observer } from 'mobx-react';
5import Invite from '../../components/auth/Invite'; 5import Invite from '../../components/auth/Invite';
6import ErrorBoundary from '../../components/util/ErrorBoundary'; 6import ErrorBoundary from '../../components/util/ErrorBoundary';
7 7
8import { gaPage } from '../../lib/analytics';
9
10export default @inject('stores', 'actions') @observer class InviteScreen extends Component { 8export default @inject('stores', 'actions') @observer class InviteScreen extends Component {
11 componentDidMount() {
12 gaPage('Settings/Invite');
13 }
14
15 componentWillUnmount() { 9 componentWillUnmount() {
16 this.props.stores.user.inviteRequest.reset(); 10 this.props.stores.user.inviteRequest.reset();
17 } 11 }
diff --git a/src/containers/settings/RecipesScreen.js b/src/containers/settings/RecipesScreen.js
index b3d758c87..eda5ae54c 100644
--- a/src/containers/settings/RecipesScreen.js
+++ b/src/containers/settings/RecipesScreen.js
@@ -7,7 +7,6 @@ import RecipePreviewsStore from '../../stores/RecipePreviewsStore';
7import RecipeStore from '../../stores/RecipesStore'; 7import RecipeStore from '../../stores/RecipesStore';
8import ServiceStore from '../../stores/ServicesStore'; 8import ServiceStore from '../../stores/ServicesStore';
9import UserStore from '../../stores/UserStore'; 9import UserStore from '../../stores/UserStore';
10import { gaPage } from '../../lib/analytics';
11 10
12import RecipesDashboard from '../../components/settings/recipes/RecipesDashboard'; 11import RecipesDashboard from '../../components/settings/recipes/RecipesDashboard';
13import ErrorBoundary from '../../components/util/ErrorBoundary'; 12import ErrorBoundary from '../../components/util/ErrorBoundary';
@@ -33,20 +32,15 @@ export default @inject('stores', 'actions') @observer class RecipesScreen extend
33 autorunDisposer = null; 32 autorunDisposer = null;
34 33
35 componentDidMount() { 34 componentDidMount() {
36 gaPage('Settings/Recipe Dashboard/Featured');
37
38 this.autorunDisposer = autorun(() => { 35 this.autorunDisposer = autorun(() => {
39 const { filter } = this.props.params; 36 const { filter } = this.props.params;
40 const { currentFilter } = this.state; 37 const { currentFilter } = this.state;
41 38
42 if (filter === 'all' && currentFilter !== 'all') { 39 if (filter === 'all' && currentFilter !== 'all') {
43 gaPage('Settings/Recipe Dashboard/All');
44 this.setState({ currentFilter: 'all' }); 40 this.setState({ currentFilter: 'all' });
45 } else if (filter === 'featured' && currentFilter !== 'featured') { 41 } else if (filter === 'featured' && currentFilter !== 'featured') {
46 gaPage('Settings/Recipe Dashboard/Featured');
47 this.setState({ currentFilter: 'featured' }); 42 this.setState({ currentFilter: 'featured' });
48 } else if (filter === 'dev' && currentFilter !== 'dev') { 43 } else if (filter === 'dev' && currentFilter !== 'dev') {
49 gaPage('Settings/Recipe Dashboard/Dev');
50 this.setState({ currentFilter: 'dev' }); 44 this.setState({ currentFilter: 'dev' });
51 } 45 }
52 }); 46 });
diff --git a/src/containers/settings/ServicesScreen.js b/src/containers/settings/ServicesScreen.js
index b70a5506e..a501bf530 100644
--- a/src/containers/settings/ServicesScreen.js
+++ b/src/containers/settings/ServicesScreen.js
@@ -6,16 +6,11 @@ import { RouterStore } from 'mobx-react-router';
6// import RecipePreviewsStore from '../../stores/RecipePreviewsStore'; 6// import RecipePreviewsStore from '../../stores/RecipePreviewsStore';
7import UserStore from '../../stores/UserStore'; 7import UserStore from '../../stores/UserStore';
8import ServiceStore from '../../stores/ServicesStore'; 8import ServiceStore from '../../stores/ServicesStore';
9import { gaPage } from '../../lib/analytics';
10 9
11import ServicesDashboard from '../../components/settings/services/ServicesDashboard'; 10import ServicesDashboard from '../../components/settings/services/ServicesDashboard';
12import ErrorBoundary from '../../components/util/ErrorBoundary'; 11import ErrorBoundary from '../../components/util/ErrorBoundary';
13 12
14export default @inject('stores', 'actions') @observer class ServicesScreen extends Component { 13export default @inject('stores', 'actions') @observer class ServicesScreen extends Component {
15 componentDidMount() {
16 gaPage('Settings/Service Dashboard');
17 }
18
19 componentWillUnmount() { 14 componentWillUnmount() {
20 this.props.actions.service.resetFilter(); 15 this.props.actions.service.resetFilter();
21 this.props.actions.service.resetStatus(); 16 this.props.actions.service.resetStatus();
diff --git a/src/features/basicAuth/index.js b/src/features/basicAuth/index.js
index 03269582c..00ad65ce6 100644
--- a/src/features/basicAuth/index.js
+++ b/src/features/basicAuth/index.js
@@ -31,15 +31,6 @@ export default function initialize() {
31 state.authInfo = data.authInfo; 31 state.authInfo = data.authInfo;
32 state.isModalVisible = true; 32 state.isModalVisible = true;
33 }); 33 });
34
35 // autorun(() => {
36 // // if (state.serviceId) {
37 // // const service = stores.services.one(state.serviceId);
38 // // if (service) {
39 // // state.service = service;
40 // // }
41 // // }
42 // });
43} 34}
44 35
45export function mainIpcHandler(mainWindow, authInfo) { 36export function mainIpcHandler(mainWindow, authInfo) {
diff --git a/src/features/delayApp/index.js b/src/features/delayApp/index.js
index 28aa50eb2..48aac34b6 100644
--- a/src/features/delayApp/index.js
+++ b/src/features/delayApp/index.js
@@ -3,7 +3,7 @@ import moment from 'moment';
3import DelayAppComponent from './Component'; 3import DelayAppComponent from './Component';
4 4
5import { DEFAULT_FEATURES_CONFIG } from '../../config'; 5import { DEFAULT_FEATURES_CONFIG } from '../../config';
6import { gaEvent } from '../../lib/analytics'; 6import { gaEvent, gaPage } from '../../lib/analytics';
7 7
8const debug = require('debug')('Franz:feature:delayApp'); 8const debug = require('debug')('Franz:feature:delayApp');
9 9
@@ -50,6 +50,7 @@ export default function init(stores) {
50 debug(`App will be delayed for ${config.delayDuration / 1000}s`); 50 debug(`App will be delayed for ${config.delayDuration / 1000}s`);
51 51
52 setVisibility(true); 52 setVisibility(true);
53 gaPage('/delayApp');
53 gaEvent('delayApp', 'show', 'Delay App Feature'); 54 gaEvent('delayApp', 'show', 'Delay App Feature');
54 55
55 timeLastDelay = moment(); 56 timeLastDelay = moment();
diff --git a/src/stores/AppStore.js b/src/stores/AppStore.js
index b21d48a11..d90f32744 100644
--- a/src/stores/AppStore.js
+++ b/src/stores/AppStore.js
@@ -1,5 +1,7 @@
1import { remote, ipcRenderer, shell } from 'electron'; 1import { remote, ipcRenderer, shell } from 'electron';
2import { action, computed, observable } from 'mobx'; 2import {
3 action, computed, observable, reaction,
4} from 'mobx';
3import moment from 'moment'; 5import moment from 'moment';
4import key from 'keymaster'; 6import key from 'keymaster';
5import { getDoNotDisturb } from '@meetfranz/electron-notification-state'; 7import { getDoNotDisturb } from '@meetfranz/electron-notification-state';
@@ -11,7 +13,7 @@ import Request from './lib/Request';
11import { CHECK_INTERVAL, DEFAULT_APP_SETTINGS } from '../config'; 13import { CHECK_INTERVAL, DEFAULT_APP_SETTINGS } from '../config';
12import { isMac, isLinux, isWindows } from '../environment'; 14import { isMac, isLinux, isWindows } from '../environment';
13import locales from '../i18n/translations'; 15import locales from '../i18n/translations';
14import { gaEvent } from '../lib/analytics'; 16import { gaEvent, gaPage } from '../lib/analytics';
15import { onVisibilityChange } from '../helpers/visibility-helper'; 17import { onVisibilityChange } from '../helpers/visibility-helper';
16import { getLocale } from '../helpers/i18n-helpers'; 18import { getLocale } from '../helpers/i18n-helpers';
17 19
@@ -184,6 +186,12 @@ export default class AppStore extends Store {
184 186
185 debug('Window is visible/focused', isVisible); 187 debug('Window is visible/focused', isVisible);
186 }); 188 });
189
190 // analytics autorun
191 reaction(() => this.stores.router.location.pathname, (pathname) => {
192 gaPage(pathname);
193 });
194 console.log('router location', this.stores.router.location);
187 } 195 }
188 196
189 @computed get cacheSize() { 197 @computed get cacheSize() {
diff --git a/src/theme/dark/index.js b/src/theme/dark/index.js
deleted file mode 100644
index 8fdb321f3..000000000
--- a/src/theme/dark/index.js
+++ /dev/null
@@ -1,19 +0,0 @@
1import hexToRgba from 'hex-to-rgba';
2
3import * as legacyStyles from '../default/legacy';
4
5export const colorBackground = legacyStyles.darkThemeGrayDarkest;
6export const colorBackgroundSubscriptionContainer = legacyStyles.themeBrandInfo;
7
8export const colorHeadline = legacyStyles.darkThemeTextColor;
9export const colorText = legacyStyles.darkThemeTextColor;
10
11// Error Handler
12export const colorWebviewErrorHandlerBackground = legacyStyles.darkThemeGrayDarkest;
13
14// Loader
15export const colorFullscreenLoaderSpinner = '#FFF';
16export const colorWebviewLoaderBackground = hexToRgba(legacyStyles.darkThemeGrayDarkest, 0.5);
17
18// Modal
19export const colorModalOverlayBackground = hexToRgba(legacyStyles.darkThemeGrayDarkest, 0.8);
diff --git a/src/theme/default/index.js b/src/theme/default/index.js
deleted file mode 100644
index 61410073d..000000000
--- a/src/theme/default/index.js
+++ /dev/null
@@ -1,35 +0,0 @@
1import hexToRgba from 'hex-to-rgba';
2
3import * as legacyStyles from './legacy';
4
5export const brandPrimary = '#3498db';
6export const brandSuccess = '#5cb85c';
7export const brandInfo = '#5bc0de';
8export const brandWarning = '#FF9F00';
9export const brandDanger = '#d9534f';
10
11export const borderRadius = legacyStyles.themeBorderRadius;
12export const borderRadiusSmall = legacyStyles.themeBorderRadiusSmall;
13
14export const colorBackground = legacyStyles.themeGrayLighter;
15export const colorHeadline = legacyStyles.themeGrayDark;
16
17export const colorText = legacyStyles.themeTextColor;
18
19// Subscription Container Component
20export const colorSubscriptionContainerBackground = 'none';
21export const colorSubscriptionContainerBorder = [1, 'solid', brandPrimary];
22export const colorSubscriptionContainerTitle = brandPrimary;
23export const colorSubscriptionContainerActionButtonBackground = brandPrimary;
24export const colorSubscriptionContainerActionButtonColor = '#FFF';
25
26// Error Handler
27export const colorWebviewErrorHandlerBackground = legacyStyles.themeGrayLighter;
28
29// Loader
30export const colorAppLoaderSpinner = '#FFF';
31export const colorFullscreenLoaderSpinner = legacyStyles.themeGrayDark;
32export const colorWebviewLoaderBackground = hexToRgba(legacyStyles.themeGrayLighter, 0.8);
33
34// Modal
35export const colorModalOverlayBackground = hexToRgba(legacyStyles.themeGrayLighter, 0.8);