// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
import LoginEmail from './login_email.jsx';
import LoginLdap from './login_ldap.jsx';
import * as Utils from '../utils/utils.jsx';
import Constants from '../utils/constants.jsx';
import {FormattedMessage} from 'mm-intl';
export default class Login extends React.Component {
constructor(props) {
super(props);
this.state = {};
}
render() {
const teamDisplayName = this.props.teamDisplayName;
const teamName = this.props.teamName;
let loginMessage = [];
if (global.window.mm_config.EnableSignUpWithGitLab === 'true') {
loginMessage.push(
);
}
if (global.window.mm_config.EnableSignUpWithGoogle === 'true') {
loginMessage.push(
);
}
const extraParam = Utils.getUrlParameter('extra');
let extraBox = '';
if (extraParam) {
let msg;
if (extraParam === Constants.SIGNIN_CHANGE) {
msg = (
);
} else if (extraParam === Constants.SIGNIN_VERIFIED) {
msg = (
);
}
if (msg != null) {
extraBox = (
{msg}
);
}
}
let emailSignup;
if (global.window.mm_config.EnableSignUpWithEmail === 'true') {
emailSignup = (
);
}
if (loginMessage.length > 0 && emailSignup) {
loginMessage = (
);
}
let forgotPassword;
if (emailSignup) {
forgotPassword = (
);
}
let userSignUp = null;
if (this.props.inviteId) {
userSignUp = (
);
}
let teamSignUp = null;
if (global.window.mm_config.EnableTeamCreation === 'true' && !Utils.isMobileApp()) {
teamSignUp = (
);
}
let ldapLogin = null;
if (global.window.mm_config.EnableLdap === 'true') {
ldapLogin = (
);
}
let findTeams = null;
if (!Utils.isMobileApp()) {
findTeams = (
);
}
return (
{teamDisplayName}
{extraBox}
{loginMessage}
{emailSignup}
{ldapLogin}
{userSignUp}
{findTeams}
{forgotPassword}
{teamSignUp}
);
}
}
Login.defaultProps = {
teamName: '',
teamDisplayName: ''
};
Login.propTypes = {
teamName: React.PropTypes.string,
teamDisplayName: React.PropTypes.string,
inviteId: React.PropTypes.string
};