mirror of
https://github.com/vale981/Vulcan
synced 2025-03-10 04:26:41 -04:00
33 lines
No EOL
1.1 KiB
JavaScript
33 lines
No EOL
1.1 KiB
JavaScript
import Telescope from 'meteor/nova:lib';
|
|
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}
|
|
documentId={props.comment._id}
|
|
successCallback={props.successCallback}
|
|
cancelCallback={props.cancelCallback}
|
|
removeSuccessCallback={props.removeSuccessCallback}
|
|
showRemove={true}
|
|
/>
|
|
</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);
|
|
|
|
Telescope.registerComponent('CommentsEditForm', CommentsEditForm, connect(mapStateToProps, mapDispatchToProps)); |