From c4eacca87d138056eded37f072ac5625a4d04377 Mon Sep 17 00:00:00 2001 From: SleepWalker Date: Sat, 12 Nov 2016 11:05:38 +0200 Subject: [PATCH] Enable bsod for testing and fixed errors due to lack of intl context --- src/components/ui/bsod/BSoD.jsx | 41 +++++++++++++++----------- src/components/ui/bsod/dispatchBsod.js | 2 +- src/index.js | 3 ++ src/services/authFlow/AuthFlow.js | 2 -- 4 files changed, 27 insertions(+), 21 deletions(-) diff --git a/src/components/ui/bsod/BSoD.jsx b/src/components/ui/bsod/BSoD.jsx index 993c1d8..bd6e81a 100644 --- a/src/components/ui/bsod/BSoD.jsx +++ b/src/components/ui/bsod/BSoD.jsx @@ -2,31 +2,36 @@ import React from 'react'; import { FormattedMessage as Message } from 'react-intl'; +import { IntlProvider } from 'components/i18n'; import appInfo from 'components/auth/appInfo/AppInfo.intl.json'; import messages from './BSoD.intl.json'; import styles from './styles.scss'; -export default function BSoD() { +// TODO: probably it is better to render this view from the App view +// to remove dependencies from store and IntlProvider +export default function BSoD({store}) { return ( -
-
-
- -
-
- -
-
- -
- - support@ely.by - -
- + +
+
+
+ +
+
+ +
+
+ +
+ + support@ely.by + +
+ +
-
+ ); } diff --git a/src/components/ui/bsod/dispatchBsod.js b/src/components/ui/bsod/dispatchBsod.js index 0954035..ef97070 100644 --- a/src/components/ui/bsod/dispatchBsod.js +++ b/src/components/ui/bsod/dispatchBsod.js @@ -12,7 +12,7 @@ export default function dispatchBsod(store = injectedStore) { onBsod && onBsod(); ReactDOM.render( - , + , document.getElementById('app') ); } diff --git a/src/index.js b/src/index.js index 827f62c..1bd17c7 100644 --- a/src/index.js +++ b/src/index.js @@ -20,6 +20,8 @@ logger.init({ sentryCdn: window.SENTRY_CDN }); +import dispatchBsod from 'components/ui/bsod/dispatchBsod'; // TODO: remove after tests + const store = storeFactory(); bsodFactory(store, stopLoading); @@ -47,6 +49,7 @@ Promise.all([ { restoreScroll(); stopLoading(); + setTimeout(dispatchBsod, 0); // TODO: remove after tests }}> {routesFactory(store)} diff --git a/src/services/authFlow/AuthFlow.js b/src/services/authFlow/AuthFlow.js index 025a2fb..ec361ba 100644 --- a/src/services/authFlow/AuthFlow.js +++ b/src/services/authFlow/AuthFlow.js @@ -11,8 +11,6 @@ import ActivationState from './ActivationState'; import CompleteState from './CompleteState'; import ResendActivationState from './ResendActivationState'; -import dispatchBsod from 'components/ui/bsod/dispatchBsod'; - export default class AuthFlow { constructor(actions) { if (typeof actions !== 'object') {