lbry-desktop/ui/component/commentReactions/index.js

21 lines
659 B
JavaScript
Raw Normal View History

import { connect } from 'react-redux';
import Comment from './view';
import {
makeSelectMyReactionsForComment,
makeSelectOthersReactionsForComment,
selectTypesReacting,
} from 'redux/selectors/comments';
2020-09-29 16:10:23 +02:00
import { doCommentReact } from 'redux/actions/comments';
2020-09-29 16:10:23 +02:00
const select = (state, props) => ({
myReacts: makeSelectMyReactionsForComment(props.commentId)(state),
othersReacts: makeSelectOthersReactionsForComment(props.commentId)(state),
typesReacting: selectTypesReacting(state),
2020-09-29 16:10:23 +02:00
});
2020-09-29 16:10:23 +02:00
const perform = dispatch => ({
react: (commentId, type) => dispatch(doCommentReact(commentId, type)),
});
export default connect(select, perform)(Comment);