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';
|
|
|
|
import { doToggleMuteChannel } 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';
|
|
|
|
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-03 19:50:16 +01:00
|
|
|
const perform = (dispatch) => ({
|
2021-02-11 06:12:41 +01:00
|
|
|
closeInlinePlayer: () => dispatch(doSetPlayingUri({ uri: null })),
|
|
|
|
deleteComment: (commentId, creatorChannelUrl) => dispatch(doCommentAbandon(commentId, creatorChannelUrl)),
|
2021-03-03 19:50:16 +01:00
|
|
|
blockChannel: (channelUri) => dispatch(doToggleMuteChannel(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);
|