2017-03-23 16:27:59 +09:00
|
|
|
import { Components, registerComponent, getFragment, withMessages } from 'meteor/vulcan:core';
|
2017-05-19 14:42:43 -06:00
|
|
|
import React from 'react';
|
|
|
|
import PropTypes from 'prop-types';
|
2017-03-23 16:27:59 +09:00
|
|
|
import Comments from "meteor/vulcan:comments";
|
2016-02-18 21:39:33 +09:00
|
|
|
|
2016-11-07 15:03:45 +09:00
|
|
|
const CommentsEditForm = (props, context) => {
|
|
|
|
return (
|
|
|
|
<div className="comments-edit-form">
|
2017-01-18 12:51:10 +01:00
|
|
|
<Components.SmartForm
|
2016-11-07 15:03:45 +09:00
|
|
|
layout="elementOnly"
|
|
|
|
collection={Comments}
|
2016-12-02 13:43:26 +01:00
|
|
|
documentId={props.comment._id}
|
2016-11-07 15:03:45 +09:00
|
|
|
successCallback={props.successCallback}
|
|
|
|
cancelCallback={props.cancelCallback}
|
2016-11-13 14:12:15 +01:00
|
|
|
removeSuccessCallback={props.removeSuccessCallback}
|
2016-11-23 11:07:48 +09:00
|
|
|
showRemove={true}
|
2017-01-30 19:46:48 +09:00
|
|
|
mutationFragment={getFragment('CommentsList')}
|
2016-11-07 15:03:45 +09:00
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
)
|
2016-03-17 17:48:25 +09:00
|
|
|
}
|
|
|
|
|
2016-11-07 15:03:45 +09:00
|
|
|
CommentsEditForm.propTypes = {
|
2017-05-19 14:42:43 -06:00
|
|
|
comment: PropTypes.object.isRequired,
|
|
|
|
successCallback: PropTypes.func,
|
|
|
|
cancelCallback: PropTypes.func
|
2016-11-15 18:33:16 +01:00
|
|
|
};
|
2016-04-04 10:21:18 +09:00
|
|
|
|
2017-02-02 16:18:33 +01:00
|
|
|
registerComponent('CommentsEditForm', CommentsEditForm, withMessages);
|