Last active
August 29, 2015 14:23
-
-
Save jorgegorka/33ef0c9e4ba6af3eb92b to your computer and use it in GitHub Desktop.
New Message Form
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NewMessageForm = React.createClass | |
handleSubmit: (e) -> | |
e.preventDefault() | |
description = React.findDOMNode(@refs.description).value.trim() | |
return unless description | |
Messages.insert({description: description}) | |
React.findDOMNode(@refs.description).value = '' | |
render: -> | |
<div className="panel-footer"> | |
<form onSubmit={@handleSubmit}> | |
<div className="input-group"> | |
<input type="text" className="form-control input-sm" ref="description" placeholder="Type your message here..." /> | |
<span className="input-group-btn"> | |
<button className="btn btn-warning btn-sm"> | |
Send Message | |
</button> | |
</span> | |
</div> | |
</form> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment