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,9 +50,19 @@ 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}>
<div className='modal-body'>
<form onSubmit={this.handleNewPost}>
<Input type='textarea' label='Write Something' placeholder='textarea'/>
<Input type='submit' value='Submit Post' data-dismiss="modal" />
</form>
</div>
</Modal>
</div>
); );
}, },
renderOverlay: function() { renderOverlay: function() {
@ -62,19 +70,7 @@ module.exports = NewPostModalButton = React.createClass({
if (!this.state.isModalOpen) { if (!this.state.isModalOpen) {
return <span/>; return <span/>;
} }
/*
*/
return (
<Modal bsStyle='primary' title={<Glyphicon glyph='pencil'/>} onRequestHide={this.handleToggle}>
<div className='modal-body'>
<form onSubmit={this.handleNewPost}>
<Input type='textarea' label='Write Something' placeholder='textarea'/>
<Input type='submit' value='Submit Post' data-dismiss="modal" />
</form>
</div>
</Modal>
);
} }
}); });
Loading…
Cancel
Save