var React = require('react/addons') var CodeEditor = require('./CodeEditor') var Catalyst = require('../Mixins/Catalyst') var Select = require('react-select') // TODO: remove var options = [ { value: 'one', label: 'One' }, { value: 'two', label: 'Two' } ] var LaunchModal = React.createClass({ mixins: [Catalyst.LinkedStateMixin], propTypes: { submit: React.PropTypes.func, close: React.PropTypes.func }, getInitialState: function () { return { snippet: { description: '', mode: 'javascript', content: '', callSign: '', tags: [] }, blueprint: { title: '', content: '', tags: [] }, currentTab: 'snippet' } }, handleClick: function (e) { e.stopPropagation() }, selectSnippetTab: function () { this.setState({currentTab: 'snippet'}) }, selectBlueprintTab: function () { this.setState({currentTab: 'blueprint'}) }, handleSnippetTagsChange: function (selected, all) { var snippet = this.state.snippet snippet.tags = all this.setState({snippet: snippet}) }, handleSnippetContentChange: function (e, value) { var snippet = this.state.snippet snippet.content = value this.setState({snippet: snippet}) }, handleBlueprintTagsChange: function (selected, all) { var blueprint = this.state.blueprint blueprint.tags = all this.setState({blueprint: blueprint}) }, handleBlueprintContentChange: function (e, value) { var blueprint = this.state.blueprint blueprint.content = value this.setState({blueprint: blueprint}) }, submit: function () { // this.props.submit('yolo') if (this.state.currentTab === 'snippet') { console.log(this.state.snippet) } else { console.log(this.state.blueprint) } }, render: function () { var form if (this.state.currentTab === 'snippet') { form = (