a05ccdd44f
## Issue 6712 Comment Moderation - time based bans ## Approach - Consolidated the 3 types of blocking buttons in the comment content menu (i.e. Block, Moderator Block, Admin Block) into 1 regular Block button. - Show a modal when Block is clicked. - Let user choose the blocklist. - Let user choose the timeout duration (this PR's impetus).
31 lines
1.5 KiB
JavaScript
31 lines
1.5 KiB
JavaScript
import { connect } from 'react-redux';
|
|
import { makeSelectChannelPermUrlForClaimUri, makeSelectClaimIsMine, makeSelectClaimForUri } from 'lbry-redux';
|
|
import { doCommentPin, doCommentModAddDelegate } from 'redux/actions/comments';
|
|
import { doChannelMute } from 'redux/actions/blocked';
|
|
// import { doSetActiveChannel } from 'redux/actions/app';
|
|
import { doOpenModal } from 'redux/actions/app';
|
|
import { doSetPlayingUri } from 'redux/actions/content';
|
|
import { selectActiveChannelClaim } from 'redux/selectors/app';
|
|
import { selectPlayingUri } from 'redux/selectors/content';
|
|
|
|
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),
|
|
playingUri: selectPlayingUri(state),
|
|
});
|
|
|
|
const perform = (dispatch) => ({
|
|
openModal: (modal, props) => dispatch(doOpenModal(modal, props)),
|
|
clearPlayingUri: () => dispatch(doSetPlayingUri({ uri: null })),
|
|
muteChannel: (channelUri) => dispatch(doChannelMute(channelUri)),
|
|
pinComment: (commentId, claimId, remove) => dispatch(doCommentPin(commentId, claimId, remove)),
|
|
// setActiveChannel: channelId => dispatch(doSetActiveChannel(channelId)),
|
|
commentModAddDelegate: (modChanId, modChanName, creatorChannelClaim) =>
|
|
dispatch(doCommentModAddDelegate(modChanId, modChanName, creatorChannelClaim, true)),
|
|
});
|
|
|
|
export default connect(select, perform)(CommentMenuList);
|