2021-02-11 06:12:41 +01:00
|
|
|
import { connect } from 'react-redux';
|
|
|
|
import { makeSelectChannelPermUrlForClaimUri, makeSelectClaimIsMine, makeSelectClaimForUri } from 'lbry-redux';
|
2021-08-12 09:10:44 +02:00
|
|
|
import { doCommentPin, doCommentModAddDelegate } 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';
|
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';
|
|
|
|
import { selectActiveChannelClaim } from 'redux/selectors/app';
|
2021-03-02 11:12:54 +01:00
|
|
|
import { selectPlayingUri } from 'redux/selectors/content';
|
2021-08-12 09:10:44 +02:00
|
|
|
|
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-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-02-11 06:12:41 +01:00
|
|
|
// setActiveChannel: channelId => dispatch(doSetActiveChannel(channelId)),
|
2021-06-19 11:52:17 +02:00
|
|
|
commentModAddDelegate: (modChanId, modChanName, creatorChannelClaim) =>
|
|
|
|
dispatch(doCommentModAddDelegate(modChanId, modChanName, creatorChannelClaim, true)),
|
2021-02-11 06:12:41 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
export default connect(select, perform)(CommentMenuList);
|