lbry-desktop/ui/component/commentReactions/index.js
2020-10-19 23:37:39 -04:00

21 lines
661 B
JavaScript

import { connect } from 'react-redux';
import Comment from './view';
import {
makeSelectMyReactionsForComment,
makeSelectOthersReactionsForComment,
selectCommentChannel,
} from 'redux/selectors/comments';
import { doCommentReact } from 'redux/actions/comments';
const select = (state, props) => ({
myReacts: makeSelectMyReactionsForComment(props.commentId)(state),
othersReacts: makeSelectOthersReactionsForComment(props.commentId)(state),
activeChannel: selectCommentChannel(state),
});
const perform = dispatch => ({
react: (commentId, type) => dispatch(doCommentReact(commentId, type)),
});
export default connect(select, perform)(Comment);