var React = require('react'); var StrategyList = require('./StrategyList'); var StrategyForm = require('./StrategyForm'); var StrategyActions = require('../../stores/StrategyActions'); var StrategiesComponent = React.createClass({ getInitialState: function() { return { createView: false }; }, onNewStrategy: function() { this.setState({createView: true}); }, onCancelNewStrategy: function() { this.setState({createView: false}); }, onSave: function(strategy) { StrategyActions.create.triggerPromise(strategy) .then(this.onCancelNewStrategy); }, onRemove: function(strategy) { StrategyActions.remove.triggerPromise(strategy); }, render: function() { return (
{this.state.createView ? this.renderCreateView() : this.renderCreateButton()}
); }, renderCreateView: function() { return ( ); }, renderCreateButton: function() { return ( ); } }); module.exports = StrategiesComponent;