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

33 lines
1.5 KiB
JavaScript
Raw Normal View History

import { connect } from 'react-redux';
2021-06-11 22:49:18 +02:00
import { doChannelMute } from 'redux/actions/blocked';
import { doCommentPin, doCommentModAddDelegate } from 'redux/actions/comments';
2021-07-19 23:22:39 +02:00
import { doOpenModal } from 'redux/actions/app';
import { doSetPlayingUri } from 'redux/actions/content';
import { selectClaimIsMine, selectClaimForUri } from 'redux/selectors/claims';
import { selectActiveChannelClaim } from 'redux/selectors/app';
import { selectModerationDelegatorsById } from 'redux/selectors/comments';
import { selectPlayingUri } from 'redux/selectors/content';
import CommentMenuList from './view';
const select = (state, props) => {
const claim = selectClaimForUri(state, props.uri);
return {
claim,
claimIsMine: selectClaimIsMine(state, claim),
activeChannelClaim: selectActiveChannelClaim(state),
playingUri: selectPlayingUri(state),
moderationDelegatorsById: selectModerationDelegatorsById(state),
};
};
const perform = (dispatch) => ({
2021-07-19 23:22:39 +02:00
openModal: (modal, props) => dispatch(doOpenModal(modal, props)),
clearPlayingUri: () => dispatch(doSetPlayingUri({ uri: null })),
2021-06-11 22:49:18 +02:00
muteChannel: (channelUri) => dispatch(doChannelMute(channelUri)),
pinComment: (commentId, claimId, remove) => dispatch(doCommentPin(commentId, claimId, remove)),
commentModAddDelegate: (modChanId, modChanName, creatorChannelClaim) =>
dispatch(doCommentModAddDelegate(modChanId, modChanName, creatorChannelClaim, true)),
});
export default connect(select, perform)(CommentMenuList);