2015-06-20 16:43:18 +02:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
import React from 'react';
|
2016-06-06 14:54:29 +02:00
|
|
|
import Link from 'react-router/es6/Link';
|
2015-06-20 16:43:18 +02:00
|
|
|
|
2015-07-13 16:57:25 +02:00
|
|
|
import LoginForm from './ascribe_forms/form_login';
|
2015-06-20 16:43:18 +02:00
|
|
|
|
2016-06-08 13:11:16 +02:00
|
|
|
import withContext from './context/with_context';
|
2016-06-07 14:53:48 +02:00
|
|
|
import { whitelabelShape } from './prop_types';
|
|
|
|
|
2016-06-13 14:35:02 +02:00
|
|
|
import { setDocumentTitle } from '../utils/dom';
|
|
|
|
import { getLangText } from '../utils/lang';
|
2015-07-01 18:58:13 +02:00
|
|
|
|
2015-07-13 16:57:25 +02:00
|
|
|
|
2015-06-20 16:43:18 +02:00
|
|
|
let LoginContainer = React.createClass({
|
2015-07-02 15:40:54 +02:00
|
|
|
propTypes: {
|
2016-06-07 14:53:48 +02:00
|
|
|
// Injected through HOCs
|
2016-06-08 14:54:05 +02:00
|
|
|
whitelabel: whitelabelShape.isRequired
|
2015-07-02 15:40:54 +02:00
|
|
|
},
|
|
|
|
|
2015-06-20 16:43:18 +02:00
|
|
|
render() {
|
2016-06-08 14:54:05 +02:00
|
|
|
const { whitelabel: { name: whitelabelName } } = this.props;
|
2016-03-07 14:04:34 +01:00
|
|
|
|
2015-10-13 16:42:40 +02:00
|
|
|
setDocumentTitle(getLangText('Log in'));
|
|
|
|
|
2015-06-20 16:43:18 +02:00
|
|
|
return (
|
|
|
|
<div className="ascribe-login-wrapper">
|
2016-06-08 14:54:05 +02:00
|
|
|
<LoginForm whitelabelName={whitelabelName} />
|
2015-07-07 10:28:39 +02:00
|
|
|
<div className="ascribe-login-text">
|
2016-03-07 14:04:34 +01:00
|
|
|
{getLangText(`Not a ${whitelabelName || 'ascribe'} user`)}? <Link to="/signup">{getLangText('Sign up')}...</Link><br/>
|
2015-09-30 18:30:50 +02:00
|
|
|
{getLangText('Forgot my password')}? <Link to="/password_reset">{getLangText('Rescue me')}...</Link>
|
2015-07-07 10:28:39 +02:00
|
|
|
</div>
|
2015-06-20 16:43:18 +02:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2016-06-08 13:11:16 +02:00
|
|
|
export default withContext(LoginContainer, 'whitelabel');
|