Vulcan/packages/nova-base-components/lib/comments/CommentsEditForm.jsx
2016-11-15 18:33:16 +01:00

33 lines
1.1 KiB
JavaScript

import React, { PropTypes, Component } from 'react';
import NovaForm from "meteor/nova:forms";
import Comments from "meteor/nova:comments";
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
const CommentsEditForm = (props, context) => {
return (
<div className="comments-edit-form">
<NovaForm
layout="elementOnly"
collection={Comments}
document={props.comment}
mutationName="commentsEdit"
fragment={Comments.fragments.full}
successCallback={props.successCallback}
cancelCallback={props.cancelCallback}
removeSuccessCallback={props.removeSuccessCallback}
/>
</div>
)
}
CommentsEditForm.propTypes = {
comment: React.PropTypes.object.isRequired,
successCallback: React.PropTypes.func,
cancelCallback: React.PropTypes.func
};
const mapStateToProps = state => ({ messages: state.messages });
const mapDispatchToProps = dispatch => bindActionCreators(Telescope.actions.messages, dispatch);
module.exports = connect(mapStateToProps, mapDispatchToProps)(CommentsEditForm);