var Router = ReactRouter, Route = Router.Route, Link = Router.Link, RouteHandler = Router.RouteHandler, DefaultRoute = Router.DefaultRoute, NotFoundRoute = Router.NotFoundRoute; var App = React.createClass({ mixins: [Router.Navigation], render: function(){ return (
); } }); var Menu = React.createClass({ mixins: [Router.Navigation, Router.State], api_url: "/api/teams?org=", getInitialState: function() { return {teams: []}; }, componentDidMount: function() { this.loadTeams(); }, loadTeams: function() { $.get(this.api_url + this.getParams().org, function(res){ this.setState({teams: res}) }.bind(this)); }, render: function() { var renderTeam = function(team) { return (
  • {team.name}
  • ) }; return (
    ); } }); var Dashboard = React.createClass({ render: function(){ return ( ); } }); var OrgStats = React.createClass({ mixins: [Router.Navigation, Router.State], render: function(){ return (
    Org stats for {this.getParams().org}
    ); } }); var TeamStats = React.createClass({ mixins: [Router.Navigation, Router.State], render: function(){ return (
    {this.getParams().team} team stats for {this.getParams().org}
    ); } }); var UserStats = React.createClass({ render: function(){ return (
    User stats!
    ); } }); var RepoStats = React.createClass({ render: function(){ return (
    Repo Stats!
    ); } }); var NotFound = React.createClass({ render: function(){ return (
    NOT FOUND :(
    ); } }); var routes = [ ]; Router.run(routes, Router.HistoryLocation, function(Handler) { React.render(, document.body); });