blob: 865bd38f81708e4b320e19d9b987470d4ae8a916 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
import React, { Component } from 'react';
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';
export default @inject('stores', 'actions') @observer class LoginScreen extends Component {
static propTypes = {
error: globalErrorPropType.isRequired,
};
componentDidMount() {
gaPage('Auth/Login');
}
render() {
const { actions, stores, error } = this.props;
return (
<Login
onSubmit={actions.user.login}
isSubmitting={stores.user.loginRequest.isExecuting}
isTokenExpired={stores.user.isTokenExpired}
isServerLogout={stores.user.logoutReason === stores.user.logoutReasonTypes.SERVER}
signupRoute={stores.user.signupRoute}
passwordRoute={stores.user.passwordRoute}
error={error}
/>
);
}
}
LoginScreen.wrappedComponent.propTypes = {
actions: PropTypes.shape({
user: PropTypes.shape({
login: PropTypes.func.isRequired,
}).isRequired,
}).isRequired,
stores: PropTypes.shape({
user: PropTypes.instanceOf(UserStore).isRequired,
}).isRequired,
};
|