2017-01-12 17:30:25 +09:00
|
|
|
import { Components, registerComponent, getRawComponent } from 'meteor/nova:core';
|
2016-03-17 17:48:25 +09:00
|
|
|
import React, { PropTypes, Component } from 'react';
|
2016-12-20 09:27:16 +09:00
|
|
|
import SmartForm from "meteor/nova:forms";
|
2016-06-23 12:17:39 +09:00
|
|
|
import Comments from "meteor/nova:comments";
|
2016-12-08 09:42:50 +01:00
|
|
|
import { withMessages } from 'meteor/nova:core';
|
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">
|
2016-12-20 09:27:16 +09:00
|
|
|
<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-13 15:48:00 +09:00
|
|
|
mutationFragment={getRawComponent('PostsCommentsThread').fragment}
|
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 = {
|
2016-03-17 17:48:25 +09:00
|
|
|
comment: React.PropTypes.object.isRequired,
|
2016-04-04 10:21:18 +09:00
|
|
|
successCallback: React.PropTypes.func,
|
2016-03-17 17:48:25 +09:00
|
|
|
cancelCallback: React.PropTypes.func
|
2016-11-15 18:33:16 +01:00
|
|
|
};
|
2016-04-04 10:21:18 +09:00
|
|
|
|
2016-12-08 09:42:50 +01:00
|
|
|
registerComponent('CommentsEditForm', CommentsEditForm, withMessages);
|