"use strict"; var UserLogin = React.createClass({ authorizeId(id) { socket.emit("users:authorize", { id: parseInt(id, 10) }); setTimeout(function () { socket.emit("gather:refresh"); }, 1000); }, handleSubmit(e) { e.preventDefault(); let id = React.findDOMNode(this.refs.authorize_id).value.trim(); if (!id) return; React.findDOMNode(this.refs.authorize_id).value = ''; this.authorizeId(id); }, render() { return (
); } }) var UserMenu = React.createClass({ getDefaultProps() { return { users: [] }; }, componentDidMount() { let self = this; socket.on('users:update', data => self.setProps({users: data.users})); }, render() { let users = this.props.users.map(user => { return (
  • {user.username}
  • ); }); return ( ); } }); var AdminPanel = React.createClass({ handleGatherReset() { socket.emit("gather:reset"); }, render() { return (
    Swap Into a Different Account
    Gather Options
    ); } }); var CurrentUser = React.createClass({ componentDidMount() { let self = this; socket.on("users:update", data => self.setProps({user: data.currentUser})); socket.emit("users:refresh"); }, render() { if (this.props.user) { var adminOptions; if (this.props.user.admin) { adminOptions = (
  • Administration
  • ) } return (
  • {this.props.user.username}  User Avatar
  • ); } else { return false; } } });