Vulcan/packages/nova-base-components/lib/comments/list/CommentEdit.jsx

34 lines
852 B
React
Raw Normal View History

2016-03-17 17:48:25 +09:00
import React, { PropTypes, Component } from 'react';
import Actions from '../../actions.js';
import NovaForm from "meteor/nova:forms";
2016-02-18 21:39:33 +09:00
2016-03-17 17:48:25 +09:00
class CommentEdit extends Component {
2016-02-18 21:39:33 +09:00
render() {
return (
<div className="comment-edit">
<NovaForm
collection={Comments}
document={this.props.comment}
currentUser={this.context.currentUser}
methodName="comments.edit"
successCallback={this.props.successCallback}
2016-02-18 21:39:33 +09:00
/>
<a className="comment-edit-cancel" onClick={this.props.cancelCallback}>Cancel</a>
</div>
2016-02-18 21:39:33 +09:00
)
}
2016-03-17 17:48:25 +09:00
}
CommentEdit.propTypes = {
comment: React.PropTypes.object.isRequired,
successCallback: React.PropTypes.func,
2016-03-17 17:48:25 +09:00
cancelCallback: React.PropTypes.func
}
2016-02-18 21:39:33 +09:00
CommentEdit.contextTypes = {
currentUser: React.PropTypes.object
}
2016-02-18 21:39:33 +09:00
module.exports = CommentEdit;