diff --git a/package.json b/package.json index 34ccfa1c7b..ab8b89bec0 100644 --- a/package.json +++ b/package.json @@ -52,6 +52,7 @@ "nconf": "0.7.1", "pg": "4.3.0", "react": "^0.13.1", + "react-router": "^0.13.2", "reflux": "^0.2.5", "reqwest": "^1.1.4", "webpack": "1.7.3", diff --git a/public/js/UnleashApp.jsx b/public/js/UnleashApp.jsx index fb804ed8a9..2ec4379c05 100644 --- a/public/js/UnleashApp.jsx +++ b/public/js/UnleashApp.jsx @@ -1,52 +1,56 @@ var React = require('react'); -var TabView = require('./components/TabView'); -var Menu = require('./components/Menu'); var UserStore = require('./stores/UserStore'); +var Menu = require('./components/Menu'); var ErrorMessages = require('./components/ErrorMessages'); var initalizer = require('./stores/initalizer'); -var LogEntriesComponent = React.createFactory(require('./components/log/LogEntriesComponent')); -var FeatureTogglesComponent = React.createFactory(require('./components/feature/FeatureTogglesComponent')); -var StrategiesComponent = React.createFactory(require('./components/strategy/StrategiesComponent')); -var ArchiveFeatureComponent = React.createFactory(require('./components/feature/ArchiveFeatureComponent')); +var LogEntriesComponent = require('./components/log/LogEntriesComponent'); +var FeatureTogglesComponent = require('./components/feature/FeatureTogglesComponent'); +var StrategiesComponent = require('./components/strategy/StrategiesComponent'); +var ArchiveFeatureComponent = require('./components/feature/ArchiveFeatureComponent'); +var Router = require('react-router'); +var DefaultRoute = Router.DefaultRoute; +var Link = Router.Link; +var Route = Router.Route; +var RouteHandler = Router.RouteHandler; UserStore.init(); -var tabPanes = [ -{ - name: 'Feature Toggles', - slug: 'feature-toggles', - content: FeatureTogglesComponent -}, -{ - name: 'Strategies', - slug: 'strategies', - content: StrategiesComponent -}, -{ - name: "Log", - slug: 'log', - content: LogEntriesComponent -}, -{ - name: "Archive", - slug: 'archive', - content: ArchiveFeatureComponent -} -]; - - var UnleashApp = React.createClass({ + contextTypes: { + router: React.PropTypes.func + }, + componentWillMount: function() { initalizer(30); }, + render: function () { return (