mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-21 13:41:40 +00:00
extract components from PlanetContainer
This commit is contained in:
56
browser/main/Components/PlanetNavigator.jsx
Normal file
56
browser/main/Components/PlanetNavigator.jsx
Normal file
@@ -0,0 +1,56 @@
|
||||
var React = require('react/addons')
|
||||
|
||||
var ModalBase = require('../Components/ModalBase')
|
||||
var LaunchModal = require('../Components/LaunchModal')
|
||||
|
||||
var PlanetNavigator = React.createClass({
|
||||
propTypes: {
|
||||
currentPlanet: React.PropTypes.shape({
|
||||
name: React.PropTypes.string
|
||||
}),
|
||||
currentUser: React.PropTypes.shape({
|
||||
name: React.PropTypes.string
|
||||
})
|
||||
},
|
||||
getInitialState: function () {
|
||||
return {
|
||||
isLaunchModalOpen: false
|
||||
}
|
||||
},
|
||||
openLaunchModal: function () {
|
||||
console.log('and...OPEN!!')
|
||||
this.setState({isLaunchModalOpen: true})
|
||||
},
|
||||
closeLaunchModal: function () {
|
||||
this.setState({isLaunchModalOpen: false})
|
||||
},
|
||||
submitLaunchModal: function (ret) {
|
||||
console.log(ret)
|
||||
this.setState({isLaunchModalOpen: false})
|
||||
},
|
||||
render: function () {
|
||||
return (
|
||||
<div className='PlanetNavigator'>
|
||||
<button onClick={this.openLaunchModal} className='btn-primary btn-block'>
|
||||
<i className='fa fa-rocket fa-fw'/> Launch
|
||||
</button>
|
||||
<ModalBase isOpen={this.state.isLaunchModalOpen} close={this.closeLaunchModal}>
|
||||
<LaunchModal submit={this.submitLaunchModal} close={this.closeLaunchModal}/>
|
||||
</ModalBase>
|
||||
<nav>
|
||||
<a>
|
||||
<i className='fa fa-home fa-fw'/> Home
|
||||
</a>
|
||||
<a>
|
||||
<i className='fa fa-code fa-fw'/> Snippets
|
||||
</a>
|
||||
<a>
|
||||
<i className='fa fa-file-text-o fa-fw'/> Blueprints
|
||||
</a>
|
||||
</nav>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
})
|
||||
|
||||
module.exports = PlanetNavigator
|
||||
Reference in New Issue
Block a user