const CommentItem = React.createClass({ propTypes: { comment: React.PropTypes.object.isRequired, // the current comment currentUser: React.PropTypes.object, // the current user }, getInitialState() { return { showReply: false, showEdit: false }; }, showReply(event) { event.preventDefault(); this.setState({showReply: true}); }, cancelReply(event) { event.preventDefault(); this.setState({showReply: false}); }, replyCallback() { this.setState({showReply: false}); }, showEdit(event) { event.preventDefault(); this.setState({showEdit: true}); }, cancelEdit(event) { event.preventDefault(); this.setState({showEdit: false}); }, editCallback() { this.setState({showEdit: false}); }, renderComment() { const htmlBody = {__html: this.props.comment.htmlBody}; return (
) }, renderReply() { ({CommentNew} = Telescope.components); return ( ) }, renderEdit() { ({CommentEdit} = Telescope.components); return (