2017-07-19 16:59:41 +09:00
|
|
|
/*
|
|
|
|
|
|
|
|
A component to configure the "new comment" form.
|
|
|
|
|
|
|
|
The "prefilledProps" option lets you prefill specific form fields
|
|
|
|
(in this case "picId"). This works even if the field is not actually
|
|
|
|
displayed in the form, as is the case here
|
|
|
|
(picId's "hidden" property is set to true in the Comments schema)
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
import React from 'react';
|
|
|
|
import { Components, registerComponent, getFragment } from 'meteor/vulcan:core';
|
|
|
|
|
|
|
|
import Comments from '../../modules/comments/collection.js';
|
|
|
|
|
|
|
|
const CommentsNewForm = ({picId}) =>
|
|
|
|
|
|
|
|
<div className="comments-new-form">
|
|
|
|
|
|
|
|
<Components.SmartForm
|
|
|
|
collection={Comments}
|
|
|
|
mutationFragment={getFragment('CommentsItemFragment')}
|
|
|
|
prefilledProps={{picId}}
|
|
|
|
/>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
2017-10-06 08:49:36 +09:00
|
|
|
registerComponent('CommentsNewForm', CommentsNewForm);
|