var React = require('react'); var ReactBootstrap = require('react-bootstrap'); var Alert = ReactBootstrap.Alert; var FormGroup = ReactBootstrap.FormGroup; var FormControl = ReactBootstrap.FormControl; var Button = ReactBootstrap.Button; var DropdownButton = ReactBootstrap.DropdownButton; var MenuItem = ReactBootstrap.MenuItem; var Row = ReactBootstrap.Row; var Col = ReactBootstrap.Col; var ReactDOM = require('react-dom'); var User = require('../models').User; const LoginBar = React.createClass({ getInitialState: function() { return {username: '', password: ''}; }, onUsernameChange: function(e) { this.setState({username: e.target.value}); }, onPasswordChange: function(e) { this.setState({password: e.target.value}); }, handleSubmit: function(e) { var user = new User(); e.preventDefault(); user.Username = ReactDOM.findDOMNode(this.refs.username).value; user.Password = ReactDOM.findDOMNode(this.refs.password).value; this.props.onLogin(user); }, handleNewUserSubmit: function(e) { e.preventDefault(); this.props.onCreateNewUser(); }, render: function() { return (
); } }); const LogoutBar = React.createClass({ handleOnSelect: function(key) { if (key == 1) { if (this.props.onAccountSettings != null) this.props.onAccountSettings(); } else if (key == 2) { this.props.onLogout(); } }, render: function() { var signedInString = "Signed in as "+this.props.user.Name; return (Error {this.props.error.ErrorId}: {this.props.error.ErrorString}