var React = require('react/addons') var ReactRouter = require('react-router') var Catalyst = require('../Mixins/Catalyst') var SnippetForm = require('./SnippetForm') var BlueprintForm = require('./BlueprintForm') var LaunchModal = React.createClass({ mixins: [Catalyst.LinkedStateMixin, ReactRouter.State], propTypes: { close: React.PropTypes.func }, getInitialState: function () { return { currentTab: 'snippet' } }, stopPropagation: function (e) { e.stopPropagation() }, selectSnippetTab: function () { this.setState({currentTab: 'snippet'}) }, selectBlueprintTab: function () { this.setState({currentTab: 'blueprint'}) }, handleKeyDown: function (e) { if (e.keyCode === 37 && e.metaKey) { this.selectSnippetTab() } if (e.keyCode === 39 && e.metaKey) { this.selectBlueprintTab() } }, render: function () { var modalBody if (this.state.currentTab === 'snippet') { modalBody = ( ) } else { modalBody = ( ) } return (
{modalBody}
) } }) module.exports = LaunchModal