lbry-desktop/ui/page/settingsCreator/index.js

43 lines
1.9 KiB
JavaScript
Raw Normal View History

2021-04-21 11:25:06 +02:00
import { connect } from 'react-redux';
import SettingsCreatorPage from './view';
2022-02-23 07:29:14 +01:00
import { doOpenModal } from 'redux/actions/app';
2021-04-21 11:25:06 +02:00
import {
doCommentBlockWords,
doCommentUnblockWords,
2021-06-16 04:27:58 +02:00
doCommentModAddDelegate,
doCommentModRemoveDelegate,
doCommentModListDelegates,
2021-04-21 11:25:06 +02:00
doFetchCreatorSettings,
doUpdateCreatorSettings,
} from 'redux/actions/comments';
import { selectActiveChannelClaim } from 'redux/selectors/app';
import {
selectSettingsByChannelId,
selectFetchingCreatorSettings,
selectFetchingBlockedWords,
2021-06-16 04:27:58 +02:00
selectModerationDelegatesById,
2021-04-21 11:25:06 +02:00
} from 'redux/selectors/comments';
const select = (state) => ({
activeChannelClaim: selectActiveChannelClaim(state),
settingsByChannelId: selectSettingsByChannelId(state),
fetchingCreatorSettings: selectFetchingCreatorSettings(state),
fetchingBlockedWords: selectFetchingBlockedWords(state),
2021-06-16 04:27:58 +02:00
moderationDelegatesById: selectModerationDelegatesById(state),
2021-04-21 11:25:06 +02:00
});
const perform = (dispatch) => ({
commentBlockWords: (channelClaim, words) => dispatch(doCommentBlockWords(channelClaim, words)),
commentUnblockWords: (channelClaim, words) => dispatch(doCommentUnblockWords(channelClaim, words)),
fetchCreatorSettings: (channelClaimId) => dispatch(doFetchCreatorSettings(channelClaimId)),
2021-04-21 11:25:06 +02:00
updateCreatorSettings: (channelClaim, settings) => dispatch(doUpdateCreatorSettings(channelClaim, settings)),
2021-06-16 04:27:58 +02:00
commentModAddDelegate: (modChanId, modChanName, creatorChannelClaim) =>
dispatch(doCommentModAddDelegate(modChanId, modChanName, creatorChannelClaim)),
commentModRemoveDelegate: (modChanId, modChanName, creatorChannelClaim) =>
dispatch(doCommentModRemoveDelegate(modChanId, modChanName, creatorChannelClaim)),
commentModListDelegates: (creatorChannelClaim) => dispatch(doCommentModListDelegates(creatorChannelClaim)),
2022-02-23 07:29:14 +01:00
doOpenModal: (modal, props) => dispatch(doOpenModal(modal, props)),
2021-04-21 11:25:06 +02:00
});
export default connect(select, perform)(SettingsCreatorPage);