var React = require('react/addons') var CodeForm = require('./CodeForm') var NoteForm = require('./NoteForm') module.exports = React.createClass({ propTypes: { planet: React.PropTypes.object, transitionTo: React.PropTypes.func, close: React.PropTypes.func }, getInitialState: function () { return { currentTab: 'code' } }, componentDidMount: function () { }, stopPropagation: function (e) { e.stopPropagation() }, selectCodeTab: function () { this.setState({currentTab: 'code'}) }, selectNoteTab: function () { this.setState({currentTab: 'note'}) }, handleKeyDown: function (e) { if (e.keyCode === 37 && e.metaKey) { this.selectCodeTab() } if (e.keyCode === 39 && e.metaKey) { this.selectNoteTab() } }, render: function () { var modalBody if (this.state.currentTab === 'code') { modalBody = ( ) } else { modalBody = ( ) } return (
{modalBody}
) } })