2021-02-11 06:12:41 +01:00
|
|
|
import { connect } from 'react-redux';
|
|
|
|
import { makeSelectChannelPermUrlForClaimUri, makeSelectClaimIsMine, makeSelectClaimForUri } from 'lbry-redux';
|
2021-03-03 19:50:16 +01:00
|
|
|
import { doCommentAbandon, doCommentPin, doCommentList, doCommentModBlock } from 'redux/actions/comments';
|
2021-06-11 22:49:18 +02:00
|
|
|
import { doChannelMute } from 'redux/actions/blocked';
|
2021-02-11 06:12:41 +01:00
|
|
|
// import { doSetActiveChannel } from 'redux/actions/app';
|
|
|
|
import { doSetPlayingUri } from 'redux/actions/content';
|
|
|
|
import { selectActiveChannelClaim } from 'redux/selectors/app';
|
2021-03-02 11:12:54 +01:00
|
|
|
import { selectPlayingUri } from 'redux/selectors/content';
|
2021-02-11 06:12:41 +01:00
|
|
|
import CommentMenuList from './view';
|
|
|
|
|
|
|
|
const select = (state, props) => ({
|
|
|
|
claim: makeSelectClaimForUri(props.uri)(state),
|
|
|
|
claimIsMine: makeSelectClaimIsMine(props.uri)(state),
|
|
|
|
contentChannelPermanentUrl: makeSelectChannelPermUrlForClaimUri(props.uri)(state),
|
|
|
|
activeChannelClaim: selectActiveChannelClaim(state),
|
2021-03-02 11:12:54 +01:00
|
|
|
playingUri: selectPlayingUri(state),
|
2021-02-11 06:12:41 +01:00
|
|
|
});
|
|
|
|
|
2021-03-03 19:50:16 +01:00
|
|
|
const perform = (dispatch) => ({
|
2021-03-02 11:12:54 +01:00
|
|
|
clearPlayingUri: () => dispatch(doSetPlayingUri({ uri: null })),
|
2021-02-11 06:12:41 +01:00
|
|
|
deleteComment: (commentId, creatorChannelUrl) => dispatch(doCommentAbandon(commentId, creatorChannelUrl)),
|
2021-06-11 22:49:18 +02:00
|
|
|
muteChannel: (channelUri) => dispatch(doChannelMute(channelUri)),
|
2021-02-11 06:12:41 +01:00
|
|
|
pinComment: (commentId, remove) => dispatch(doCommentPin(commentId, remove)),
|
2021-03-03 19:50:16 +01:00
|
|
|
fetchComments: (uri) => dispatch(doCommentList(uri)),
|
2021-02-11 06:12:41 +01:00
|
|
|
// setActiveChannel: channelId => dispatch(doSetActiveChannel(channelId)),
|
2021-03-03 19:50:16 +01:00
|
|
|
commentModBlock: (commentAuthor) => dispatch(doCommentModBlock(commentAuthor)),
|
2021-02-11 06:12:41 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
export default connect(select, perform)(CommentMenuList);
|