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';
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';
2021-06-16 04:27:58 +02:00
import { doToast } from 'redux/actions/notifications';
2021-04-21 11:25:06 +02:00
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)),
doToast: (options) => dispatch(doToast(options)),
2021-04-21 11:25:06 +02:00
});
export default connect(select, perform)(SettingsCreatorPage);