2018-04-12 01:58:04 +03:00
|
|
|
/*
|
|
|
|
Copyright 2017 Vector Creations Ltd
|
2019-01-22 02:49:50 +03:00
|
|
|
Copyright 2018, 2019 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');
|
2019-01-22 02:49:50 +03:00
|
|
|
import { _t } from '../../../languageHandler';
|
|
|
|
const dis = require('../../../dispatcher');
|
|
|
|
const AccessibleButton = require('../elements/AccessibleButton');
|
2018-04-12 01:58:04 +03:00
|
|
|
|
|
|
|
module.exports = React.createClass({
|
2019-01-22 02:49:50 +03:00
|
|
|
displayName: 'AuthButtons',
|
2018-04-12 01:58:04 +03:00
|
|
|
|
|
|
|
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 = (
|
2019-01-22 02:49:50 +03:00
|
|
|
<div className="mx_AuthButtons_loginButton_wrapper">
|
|
|
|
<AccessibleButton className="mx_AuthButtons_loginButton" element="button" onClick={this.onLoginClick}>
|
2018-10-15 23:26:02 +03:00
|
|
|
{ _t("Login") }
|
2018-04-12 01:58:04 +03:00
|
|
|
</AccessibleButton>
|
2019-01-22 02:49:50 +03:00
|
|
|
<AccessibleButton className="mx_AuthButtons_registerButton" element="button" onClick={this.onRegisterClick}>
|
2018-10-15 23:26:02 +03:00
|
|
|
{ _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 (
|
2019-01-22 02:49:50 +03:00
|
|
|
<div className="mx_AuthButtons">
|
2018-04-12 01:58:04 +03:00
|
|
|
{ loginButton }
|
|
|
|
</div>
|
|
|
|
);
|
2018-10-27 06:50:35 +03:00
|
|
|
},
|
2018-04-12 01:58:04 +03:00
|
|
|
});
|