Vulcan/packages/vulcan-base-components/lib/comments/CommentsEditForm.jsx

30 lines
908 B
React
Raw Normal View History

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">
<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}
removeSuccessCallback={props.removeSuccessCallback}
2016-11-23 11:07:48 +09:00
showRemove={true}
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
};
registerComponent('CommentsEditForm', CommentsEditForm, withMessages);