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

23 lines
980 B
JavaScript
Raw Permalink Normal View History

import { connect } from 'react-redux';
import Comment from './view';
2020-10-27 17:24:31 +01:00
import { makeSelectClaimIsMine, makeSelectClaimForUri } from 'lbry-redux';
import { doToast } from 'redux/actions/notifications';
import { makeSelectMyReactionsForComment, makeSelectOthersReactionsForComment } from 'redux/selectors/comments';
2020-09-29 16:10:23 +02:00
import { doCommentReact } from 'redux/actions/comments';
import { selectActiveChannelId } from 'redux/selectors/app';
2020-09-29 16:10:23 +02:00
const select = (state, props) => ({
2020-10-27 17:24:31 +01:00
claim: makeSelectClaimForUri(props.uri)(state),
claimIsMine: makeSelectClaimIsMine(props.uri)(state),
2020-09-29 16:10:23 +02:00
myReacts: makeSelectMyReactionsForComment(props.commentId)(state),
othersReacts: makeSelectOthersReactionsForComment(props.commentId)(state),
activeChannelId: selectActiveChannelId(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)),
doToast: params => dispatch(doToast(params)),
2020-09-29 16:10:23 +02:00
});
export default connect(select, perform)(Comment);