2018-04-12 01:58:04 +03:00
|
|
|
/*
|
|
|
|
Copyright 2017 Vector Creations Ltd
|
2018-10-15 23:26:02 +03:00
|
|
|
Copyright 2018 New Vector Ltd
|
2018-04-12 01:58:04 +03:00
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
|
|
|
*/
|
|
|
|
|
|
|
|
'use strict';
|
|
|
|
|
2018-10-15 23:26:02 +03:00
|
|
|
const React = require('react');
|
2018-04-13 02:43:44 +03:00
|
|
|
import { _t } from '../../languageHandler';
|
2018-10-15 23:26:02 +03:00
|
|
|
const dis = require('../../dispatcher');
|
|
|
|
const AccessibleButton = require('../../components/views/elements/AccessibleButton');
|
2018-04-12 01:58:04 +03:00
|
|
|
|
|
|
|
module.exports = React.createClass({
|
|
|
|
displayName: 'LoginBox',
|
|
|
|
|
|
|
|
propTypes: {
|
|
|
|
},
|
|
|
|
|
|
|
|
onLoginClick: function() {
|
|
|
|
dis.dispatch({ action: 'start_login' });
|
|
|
|
},
|
|
|
|
|
|
|
|
onRegisterClick: function() {
|
|
|
|
dis.dispatch({ action: 'start_registration' });
|
|
|
|
},
|
|
|
|
|
|
|
|
render: function() {
|
2018-10-15 23:26:02 +03:00
|
|
|
const loginButton = (
|
|
|
|
<div className="mx_LoginBox_loginButton_wrapper">
|
|
|
|
<AccessibleButton className="mx_LoginBox_loginButton" element="button" onClick={this.onLoginClick}>
|
|
|
|
{ _t("Login") }
|
2018-04-12 01:58:04 +03:00
|
|
|
</AccessibleButton>
|
2018-10-15 23:26:02 +03:00
|
|
|
<AccessibleButton className="mx_LoginBox_registerButton" element="button" onClick={this.onRegisterClick}>
|
|
|
|
{ _t("Register") }
|
2018-04-12 01:58:04 +03:00
|
|
|
</AccessibleButton>
|
2018-10-15 23:26:02 +03:00
|
|
|
</div>
|
|
|
|
);
|
2018-04-12 01:58:04 +03:00
|
|
|
|
|
|
|
return (
|
2018-10-15 23:26:02 +03:00
|
|
|
<div className="mx_LoginBox">
|
2018-04-12 01:58:04 +03:00
|
|
|
{ loginButton }
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
});
|