react-code-dataset / facenovel /frontend /components /comments /create_comment_form_container.js
Devendra174's picture
Upload folder using huggingface_hub
f5071ca verified
raw
history blame contribute delete
574 Bytes
import { connect } from 'react-redux';
import CommentForm from './comment_form';
import { createComment } from '../../actions/comment_actions';
const mapStateToProps = (state, ownProps) => {
const comment = {
authorId: state.session.currentUserId,
postId: ownProps.postId,
body: ''
};
return ({
author: state.entities.users[state.session.currentUserId],
comment
});
};
const mapDispatchToProps = dispatch => ({
action: comment => dispatch(createComment(comment))
});
export default connect(mapStateToProps, mapDispatchToProps)(CommentForm);