2020-09-11 13:51:31 -04:00
|
|
|
import { connect } from 'react-redux';
|
|
|
|
import Comment from './view';
|
2020-10-01 20:25:30 -04:00
|
|
|
import { makeSelectMyReactionsForComment, makeSelectOthersReactionsForComment } from 'redux/selectors/comments';
|
2020-09-29 10:10:23 -04:00
|
|
|
import { doCommentReact } from 'redux/actions/comments';
|
2020-09-11 13:51:31 -04:00
|
|
|
|
2020-09-29 10:10:23 -04:00
|
|
|
const select = (state, props) => ({
|
|
|
|
myReacts: makeSelectMyReactionsForComment(props.commentId)(state),
|
|
|
|
othersReacts: makeSelectOthersReactionsForComment(props.commentId)(state),
|
|
|
|
});
|
2020-09-11 13:51:31 -04:00
|
|
|
|
2020-09-29 10:10:23 -04:00
|
|
|
const perform = dispatch => ({
|
|
|
|
react: (commentId, type) => dispatch(doCommentReact(commentId, type)),
|
|
|
|
});
|
2020-09-11 13:51:31 -04:00
|
|
|
|
|
|
|
export default connect(select, perform)(Comment);
|