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