1
0
mirror of https://github.com/ascribe/onion.git synced 2024-06-30 21:52:08 +02:00
onion/js/components/login_container.js

39 lines
1.2 KiB
JavaScript
Raw Normal View History

2015-06-20 16:43:18 +02:00
'use strict';
import React from 'react';
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
import withContext from './context/with_context';
import { whitelabelShape } from './prop_types';
import { setDocumentTitle } from '../utils/dom';
import { getLangText } from '../utils/lang';
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: {
// 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;
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">
{getLangText(`Not a ${whitelabelName || 'ascribe'} user`)}&#63; <Link to="/signup">{getLangText('Sign up')}...</Link><br/>
{getLangText('Forgot my password')}&#63; <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>
);
}
});
export default withContext(LoginContainer, 'whitelabel');