2021-02-11 06:12:41 +01:00
|
|
|
import { connect } from 'react-redux';
|
2021-06-11 22:49:18 +02:00
|
|
|
import { doChannelMute } from 'redux/actions/blocked';
|
2021-10-04 15:20:37 +02:00
|
|
|
import { doCommentPin, doCommentModAddDelegate } from 'redux/actions/comments';
|
2021-07-19 23:22:39 +02:00
|
|
|
import { doOpenModal } from 'redux/actions/app';
|
2021-02-11 06:12:41 +01:00
|
|
|
import { doSetPlayingUri } from 'redux/actions/content';
|
2021-10-04 15:20:37 +02:00
|
|
|
import { doToast } from 'redux/actions/notifications';
|
2021-10-08 05:47:39 +02:00
|
|
|
import {
|
|
|
|
makeSelectChannelPermUrlForClaimUri,
|
|
|
|
makeSelectClaimIsMine,
|
|
|
|
makeSelectClaimForUri,
|
|
|
|
} from 'redux/selectors/claims';
|
2021-02-11 06:12:41 +01:00
|
|
|
import { selectActiveChannelClaim } from 'redux/selectors/app';
|
2021-09-08 18:31:45 +02:00
|
|
|
import { selectModerationDelegatorsById } from 'redux/selectors/comments';
|
2021-10-04 15:20:37 +02: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-09-08 18:31:45 +02:00
|
|
|
moderationDelegatorsById: selectModerationDelegatorsById(state),
|
2021-02-11 06:12:41 +01:00
|
|
|
});
|
|
|
|
|
2021-03-03 19:50:16 +01:00
|
|
|
const perform = (dispatch) => ({
|
2021-07-19 23:22:39 +02:00
|
|
|
openModal: (modal, props) => dispatch(doOpenModal(modal, props)),
|
2021-03-02 11:12:54 +01:00
|
|
|
clearPlayingUri: () => dispatch(doSetPlayingUri({ uri: null })),
|
2021-06-11 22:49:18 +02:00
|
|
|
muteChannel: (channelUri) => dispatch(doChannelMute(channelUri)),
|
2021-07-15 16:43:28 +02:00
|
|
|
pinComment: (commentId, claimId, remove) => dispatch(doCommentPin(commentId, claimId, remove)),
|
2021-06-19 11:52:17 +02:00
|
|
|
commentModAddDelegate: (modChanId, modChanName, creatorChannelClaim) =>
|
|
|
|
dispatch(doCommentModAddDelegate(modChanId, modChanName, creatorChannelClaim, true)),
|
2021-10-04 15:20:37 +02:00
|
|
|
doToast: (props) => dispatch(doToast(props)),
|
2021-02-11 06:12:41 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
export default connect(select, perform)(CommentMenuList);
|