blob: 9e22c5141f2cf115935c14620ba9fb7884a1532f (
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
45
|
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';
@inject('stores', 'actions') @observer
export default 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,
};
|