diff options
author | Stefan Malzner <stefan@adlk.io> | 2017-10-13 12:29:40 +0200 |
---|---|---|
committer | Stefan Malzner <stefan@adlk.io> | 2017-10-13 12:29:40 +0200 |
commit | 58cda9cc7fb79ca9df6746de7f9662bc08dc156a (patch) | |
tree | 1211600c2a5d3b5f81c435c6896618111a611720 /src/containers/auth/LoginScreen.js | |
download | ferdium-app-58cda9cc7fb79ca9df6746de7f9662bc08dc156a.tar.gz ferdium-app-58cda9cc7fb79ca9df6746de7f9662bc08dc156a.tar.zst ferdium-app-58cda9cc7fb79ca9df6746de7f9662bc08dc156a.zip |
initial commit
Diffstat (limited to 'src/containers/auth/LoginScreen.js')
-rw-r--r-- | src/containers/auth/LoginScreen.js | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/src/containers/auth/LoginScreen.js b/src/containers/auth/LoginScreen.js new file mode 100644 index 000000000..9e22c5141 --- /dev/null +++ b/src/containers/auth/LoginScreen.js | |||
@@ -0,0 +1,45 @@ | |||
1 | import React, { Component } from 'react'; | ||
2 | import PropTypes from 'prop-types'; | ||
3 | import { inject, observer } from 'mobx-react'; | ||
4 | import Login from '../../components/auth/Login'; | ||
5 | import UserStore from '../../stores/UserStore'; | ||
6 | import { gaPage } from '../../lib/analytics'; | ||
7 | |||
8 | import { globalError as globalErrorPropType } from '../../prop-types'; | ||
9 | |||
10 | @inject('stores', 'actions') @observer | ||
11 | export default class LoginScreen extends Component { | ||
12 | static propTypes = { | ||
13 | error: globalErrorPropType.isRequired, | ||
14 | }; | ||
15 | |||
16 | componentDidMount() { | ||
17 | gaPage('Auth/Login'); | ||
18 | } | ||
19 | |||
20 | render() { | ||
21 | const { actions, stores, error } = this.props; | ||
22 | return ( | ||
23 | <Login | ||
24 | onSubmit={actions.user.login} | ||
25 | isSubmitting={stores.user.loginRequest.isExecuting} | ||
26 | isTokenExpired={stores.user.isTokenExpired} | ||
27 | isServerLogout={stores.user.logoutReason === stores.user.logoutReasonTypes.SERVER} | ||
28 | signupRoute={stores.user.signupRoute} | ||
29 | passwordRoute={stores.user.passwordRoute} | ||
30 | error={error} | ||
31 | /> | ||
32 | ); | ||
33 | } | ||
34 | } | ||
35 | |||
36 | LoginScreen.wrappedComponent.propTypes = { | ||
37 | actions: PropTypes.shape({ | ||
38 | user: PropTypes.shape({ | ||
39 | login: PropTypes.func.isRequired, | ||
40 | }).isRequired, | ||
41 | }).isRequired, | ||
42 | stores: PropTypes.shape({ | ||
43 | user: PropTypes.instanceOf(UserStore).isRequired, | ||
44 | }).isRequired, | ||
45 | }; | ||