From 97afc144d4cf3c93c82d3381636c3d31d9324ef9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivar=20Conradi=20=C3=98sthus?= Date: Tue, 17 Mar 2015 22:21:49 +0100 Subject: [PATCH] wrapping app-stuff --- public/js/UnleashApp.jsx | 62 ++++++++++++++++++++++++++++++++++++++++ public/js/app.jsx | 50 ++------------------------------ 2 files changed, 65 insertions(+), 47 deletions(-) create mode 100644 public/js/UnleashApp.jsx diff --git a/public/js/UnleashApp.jsx b/public/js/UnleashApp.jsx new file mode 100644 index 0000000000..3690e0cb61 --- /dev/null +++ b/public/js/UnleashApp.jsx @@ -0,0 +1,62 @@ +var React = require('react'); +var TabView = require('./components/TabView'); +var Menu = require('./components/Menu'); +var UserStore = require('./stores/UserStore'); +var ErrorMessages = require('./components/ErrorMessages'); +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')); + +UserStore.init(); + +var tabPanes = [ +{ + name: 'Feature Toggles', + slug: 'feature-toggles', + content: new FeatureTogglesComponent({}) +}, +{ + name: 'Strategies', + slug: 'strategies', + content: new StrategiesComponent({}) +}, +{ + name: "Log", + slug: 'log', + content: new LogEntriesComponent({}) +}, +{ + name: "Archive", + slug: 'archive', + content: new ArchiveFeatureComponent({}) +} +]; + + +var UnleashApp = React.createClass({ + getInitialState: function() { + return { + featureToggles: [], + archivedToggles: [], + strategies: [] + + }; + }, + + render: function () { + return ( +
+ +
+
+ + +
+
+
+ ); + } +}); + +module.exports = UnleashApp; diff --git a/public/js/app.jsx b/public/js/app.jsx index 276e6b701c..4cf42046b0 100644 --- a/public/js/app.jsx +++ b/public/js/app.jsx @@ -1,47 +1,3 @@ -var React = require('react'); -var TabView = require('./components/TabView'); -var Menu = require('./components/Menu'); -var UserStore = require('./stores/UserStore'); -var ErrorMessages = require('./components/ErrorMessages'); -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')); - -UserStore.init(); - -var tabPanes = [ - { - name: 'Feature Toggles', - slug: 'feature-toggles', - content: new FeatureTogglesComponent({pollInterval: 5000}) - }, - { - name: 'Strategies', - slug: 'strategies', - content: new StrategiesComponent({}) - }, - { - name: "Log", - slug: 'log', - content: new LogEntriesComponent({}) - }, - { - name: "Archive", - slug: 'archive', - content: new ArchiveFeatureComponent({}) - } -]; - -React.render( -
- -
-
- - -
-
-
, - document.getElementById('content') -); +var React = require('react'); +var UnleashApp = require('./UnleashApp'); +React.render(, document.getElementById('content'));