aboutsummaryrefslogtreecommitdiffstats
path: root/src/containers/auth/AuthLayoutContainer.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/containers/auth/AuthLayoutContainer.js')
-rw-r--r--src/containers/auth/AuthLayoutContainer.js47
1 files changed, 47 insertions, 0 deletions
diff --git a/src/containers/auth/AuthLayoutContainer.js b/src/containers/auth/AuthLayoutContainer.js
new file mode 100644
index 000000000..004054fdd
--- /dev/null
+++ b/src/containers/auth/AuthLayoutContainer.js
@@ -0,0 +1,47 @@
1import React, { Component } from 'react';
2import PropTypes from 'prop-types';
3import { inject, observer } from 'mobx-react';
4
5import AuthLayout from '../../components/auth/AuthLayout';
6import AppStore from '../../stores/AppStore';
7import GlobalErrorStore from '../../stores/GlobalErrorStore';
8
9import { oneOrManyChildElements } from '../../prop-types';
10
11@inject('stores', 'actions') @observer
12export default class AuthLayoutContainer extends Component {
13 static propTypes = {
14 children: oneOrManyChildElements.isRequired,
15 location: PropTypes.shape({
16 pathname: PropTypes.string.isRequired,
17 }).isRequired,
18 };
19
20 render() {
21 const { stores, actions, children, location } = this.props;
22 return (
23 <AuthLayout
24 error={stores.globalError.response}
25 pathname={location.pathname}
26 isOnline={stores.app.isOnline}
27 isAPIHealthy={!stores.app.healthCheckRequest.isError}
28 retryHealthCheck={actions.app.healthCheck}
29 isHealthCheckLoading={stores.app.healthCheckRequest.isExecuting}
30 >
31 {children}
32 </AuthLayout>
33 );
34 }
35}
36
37AuthLayoutContainer.wrappedComponent.propTypes = {
38 stores: PropTypes.shape({
39 app: PropTypes.instanceOf(AppStore).isRequired,
40 globalError: PropTypes.instanceOf(GlobalErrorStore).isRequired,
41 }).isRequired,
42 actions: PropTypes.shape({
43 app: PropTypes.shape({
44 healthCheck: PropTypes.func.isRequired,
45 }).isRequired,
46 }).isRequired,
47};