Browse Source

upgrade to react-router 2.0 yay

master
Julian Steinwachs 9 years ago
parent
commit
e51c9ce13e
  1. 24
      jsx/home/NewPostModalButton.js

24
jsx/home/NewPostModalButton.js

@ -1,6 +1,5 @@
var ReactBootstrap = require('react-bootstrap') var ReactBootstrap = require('react-bootstrap')
, OverlayMixin = ReactBootstrap.OverlayMixin
, Button = ReactBootstrap.Button , Button = ReactBootstrap.Button
, ButtonGroup = ReactBootstrap.ButtonGroup , ButtonGroup = ReactBootstrap.ButtonGroup
, Glyphicon = ReactBootstrap.Glyphicon , Glyphicon = ReactBootstrap.Glyphicon
@ -14,7 +13,6 @@ var SetIntervalMixin = require("../common/SetIntervalMixin.js");
var TwistComposer = require("../common/TwistComposer.js"); var TwistComposer = require("../common/TwistComposer.js");
module.exports = NewPostModalButton = React.createClass({ module.exports = NewPostModalButton = React.createClass({
mixins: [OverlayMixin],
getInitialState: function () { getInitialState: function () {
return { return {
isModalOpen: false isModalOpen: false
@ -52,21 +50,11 @@ module.exports = NewPostModalButton = React.createClass({
}, },
render: function() { render: function() {
return ( return (
<div>
<Button onClick={this.handleToggle} className="link-button-gray pull-right fullytight_all" bsStyle="link"> <Button onClick={this.handleToggle} className="link-button-gray pull-right fullytight_all" bsStyle="link">
<Glyphicon glyph='pencil' /> <Glyphicon glyph='pencil' />
</Button> </Button>
); <Modal show={this.state.isModalOpen} bsStyle='primary' title={<Glyphicon glyph='pencil'/>} onRequestHide={this.handleToggle}>
},
renderOverlay: function() {
if (!this.state.isModalOpen) {
return <span/>;
}
/*
*/
return (
<Modal bsStyle='primary' title={<Glyphicon glyph='pencil'/>} onRequestHide={this.handleToggle}>
<div className='modal-body'> <div className='modal-body'>
<form onSubmit={this.handleNewPost}> <form onSubmit={this.handleNewPost}>
<Input type='textarea' label='Write Something' placeholder='textarea'/> <Input type='textarea' label='Write Something' placeholder='textarea'/>
@ -74,7 +62,15 @@ module.exports = NewPostModalButton = React.createClass({
</form> </form>
</div> </div>
</Modal> </Modal>
</div>
); );
},
renderOverlay: function() {
if (!this.state.isModalOpen) {
return <span/>;
}
} }
}); });
Loading…
Cancel
Save