// Import all the objects we want to use from ReactBootstrap var Alert = ReactBootstrap.Alert; var Input = ReactBootstrap.Input; var Button = ReactBootstrap.Button; var DropdownButton = ReactBootstrap.DropdownButton; var MenuItem = ReactBootstrap.MenuItem; var Row = ReactBootstrap.Row; var Col = ReactBootstrap.Col; var 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 = this.refs.username.getValue(); user.Password = this.refs.password.getValue(); this.props.onLoginSubmit(user); }, handleNewUserSubmit: function(e) { e.preventDefault(); this.props.onCreateNewUser(); }, render: function() { return (
); } }); var LogoutBar = React.createClass({ handleOnSelect: function(key) { if (key == 1) { if (this.props.onAccountSettings != null) this.props.onAccountSettings(); } else if (key == 2) { this.props.onLogoutSubmit(); } }, render: function() { var signedInString = "Signed in as "+this.props.user.Name; return (
Account Settings Logout
); } }); var TopBar = React.createClass({ render: function() { var barContents; var errorAlert; if (!this.props.user.isUser()) barContents = ; else barContents = ; if (this.props.error.isError()) errorAlert =

Error!

Error {this.props.error.ErrorId}: {this.props.error.ErrorString}

; return (
{barContents} {errorAlert}
); } });