"use strict"; var UserLogin = React.createClass({ authorizeId: function (id) { socket.emit("users:authorize", { id: parseInt(id, 10) }); setTimeout(function () { socket.emit("gather:refresh"); }, 1000); }, handleSubmit: function (e) { e.preventDefault(); var id = React.findDOMNode(this.refs.authorize_id).value.trim(); if (!id) return; React.findDOMNode(this.refs.authorize_id).value = ''; this.authorizeId(id); }, render: function () { return (

Just a temporary measure until genuine authentication is implemented

); } }) var UserMenu = React.createClass({ getDefaultProps: function () { return { users: [] }; }, componentDidMount: function () { var self = this; socket.on('users:update', function (data) { self.setProps({ users: data.users }); }); }, render: function () { var users = this.props.users.map(function (user) { return (
  • {user.username}
  • ); }); return ( ); } }); var AdminPanel = React.createClass({ handleGatherReset: function () { socket.emit("gather:reset"); }, render: function () { return ( ) } }); var CurrentUser = React.createClass({ componentDidMount: function () { var self = this; socket.on("users:update", function (data) { self.setProps({ user: data.currentUser }); }); socket.emit("users:refresh"); }, render: function () { if (this.props.user) { return (
  • {this.props.user.username}  User Avatar
  • ); } else { return false; } } });