Additional cosmetic reformatting to meet new es6 requirements

Этот коммит содержится в:
Reed Garmsen
2015-08-19 12:22:37 -07:00
родитель d0e3d9aef8
Коммит c7185ffb68

Просмотреть файл

@@ -7,14 +7,13 @@ var UserStore = require('../stores/user_store.jsx');
var BrowserStore = require('../stores/browser_store.jsx'); var BrowserStore = require('../stores/browser_store.jsx');
var Constants = require('../utils/constants.jsx'); var Constants = require('../utils/constants.jsx');
module.exports = React.createClass({ export default class Login extends React.Component {
displayName: 'Login', constructor(props) {
propTypes: { super(props);
teamName: React.PropTypes.string, this.handleSubmit = this.handleSubmit.bind(this);
teamDisplayName: React.PropTypes.string, this.state = {};
authServices: React.PropTypes.object }
}, handleSubmit(e) {
handleSubmit: function(e) {
e.preventDefault(); e.preventDefault();
var state = {}; var state = {};
@@ -70,11 +69,8 @@ module.exports = React.createClass({
this.setState(state); this.setState(state);
}.bind(this) }.bind(this)
); );
}, }
getInitialState: function() { render() {
return { };
},
render: function() {
var serverError; var serverError;
if (this.state.serverError) { if (this.state.serverError) {
serverError = <label className='control-label'>{this.state.serverError}</label>; serverError = <label className='control-label'>{this.state.serverError}</label>;
@@ -130,13 +126,33 @@ module.exports = React.createClass({
{serverError} {serverError}
</div> </div>
<div className={'form-group' + errorClass}> <div className={'form-group' + errorClass}>
<input autoFocus={focusEmail} type='email' className='form-control' name='email' defaultValue={priorEmail} ref='email' placeholder='Email' /> <input
autoFocus={focusEmail}
type='email'
className='form-control'
name='email'
defaultValue={priorEmail}
ref='email'
placeholder='Email'
/>
</div> </div>
<div className={'form-group' + errorClass}> <div className={'form-group' + errorClass}>
<input autoFocus={focusPassword} type='password' className='form-control' name='password' ref='password' placeholder='Password' /> <input
autoFocus={focusPassword}
type='password'
className='form-control'
name='password'
ref='password'
placeholder='Password'
/>
</div> </div>
<div className='form-group'> <div className='form-group'>
<button type='submit' className='btn btn-primary'>Sign in</button> <button
type='submit'
className='btn btn-primary'
>
Sign in
</button>
</div> </div>
{loginMessage} {loginMessage}
<div className='form-group margin--extra form-group--small'> <div className='form-group margin--extra form-group--small'>
@@ -146,10 +162,28 @@ module.exports = React.createClass({
<a href={'/' + teamName + '/reset_password'}>I forgot my password</a> <a href={'/' + teamName + '/reset_password'}>I forgot my password</a>
</div> </div>
<div className='margin--extra'> <div className='margin--extra'>
<span>{'Want to create your own ' + strings.Team + '?'} <a href='/' className='signup-team-login'>Sign up now</a></span> <span>{'Want to create your own ' + strings.Team + '? '}
<a
href='/'
className='signup-team-login'
>
Sign up now
</a>
</span>
</div> </div>
</form> </form>
</div> </div>
); );
} }
}); }
Login.defaultProps = {
teamName: '',
teamDisplayName: '',
authServices: ''
};
Login.propTypes = {
teamName: React.PropTypes.string,
teamDisplayName: React.PropTypes.string,
authServices: React.PropTypes.string
};