2019-06-11 20:10:58 +02:00
|
|
|
import { connect } from 'react-redux';
|
2019-08-02 02:56:25 +02:00
|
|
|
import {
|
2022-03-25 08:53:04 +01:00
|
|
|
selectById,
|
2021-09-09 09:02:31 +02:00
|
|
|
selectClaimsByUri,
|
2019-08-23 03:04:48 +02:00
|
|
|
selectClaimSearchByQuery,
|
2020-07-12 08:28:41 +02:00
|
|
|
selectClaimSearchByQueryLastPageReached,
|
2019-08-02 02:56:25 +02:00
|
|
|
selectFetchingClaimSearch,
|
2021-10-17 10:36:14 +02:00
|
|
|
} from 'redux/selectors/claims';
|
2022-03-25 08:53:04 +01:00
|
|
|
import { doClaimSearch, doResolveClaimIds, doResolveUris } from 'redux/actions/claims';
|
2021-10-17 10:36:14 +02:00
|
|
|
import * as SETTINGS from 'constants/settings';
|
2020-10-05 20:31:51 +02:00
|
|
|
import { selectFollowedTags } from 'redux/selectors/tags';
|
2021-03-03 19:50:16 +01:00
|
|
|
import { selectMutedChannels } from 'redux/selectors/blocked';
|
2022-03-09 19:05:37 +01:00
|
|
|
import { doFetchUserMemberships } from 'redux/actions/user';
|
2021-11-23 05:29:04 +01:00
|
|
|
import { selectClientSetting, selectShowMatureContent, selectLanguage } from 'redux/selectors/settings';
|
2021-03-03 19:50:16 +01:00
|
|
|
import { selectModerationBlockList } from 'redux/selectors/comments';
|
2019-06-19 07:05:43 +02:00
|
|
|
import ClaimListDiscover from './view';
|
2021-09-09 09:02:31 +02:00
|
|
|
import { doFetchViewCount } from 'lbryinc';
|
2021-07-03 19:19:23 +02:00
|
|
|
|
2021-11-24 15:35:47 +01:00
|
|
|
const select = (state, props) => ({
|
2020-03-12 02:43:52 +01:00
|
|
|
followedTags: selectFollowedTags(state),
|
2019-08-23 03:04:48 +02:00
|
|
|
claimSearchByQuery: selectClaimSearchByQuery(state),
|
2020-07-12 08:28:41 +02:00
|
|
|
claimSearchByQueryLastPageReached: selectClaimSearchByQueryLastPageReached(state),
|
2021-09-09 09:02:31 +02:00
|
|
|
claimsByUri: selectClaimsByUri(state),
|
2022-03-25 08:53:04 +01:00
|
|
|
claimsById: selectById(state),
|
2021-11-24 15:35:47 +01:00
|
|
|
loading: props.loading !== undefined ? props.loading : selectFetchingClaimSearch(state),
|
2021-03-31 22:55:26 +02:00
|
|
|
showNsfw: selectShowMatureContent(state),
|
2021-11-23 05:29:04 +01:00
|
|
|
hideReposts: selectClientSetting(state, SETTINGS.HIDE_REPOSTS),
|
2020-11-25 19:04:07 +01:00
|
|
|
languageSetting: selectLanguage(state),
|
2021-03-03 19:50:16 +01:00
|
|
|
mutedUris: selectMutedChannels(state),
|
|
|
|
blockedUris: selectModerationBlockList(state),
|
2021-11-23 05:29:04 +01:00
|
|
|
searchInLanguage: selectClientSetting(state, SETTINGS.SEARCH_IN_LANGUAGE),
|
2019-06-11 20:10:58 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
const perform = {
|
|
|
|
doClaimSearch,
|
2021-09-09 09:02:31 +02:00
|
|
|
doFetchViewCount,
|
2022-03-09 19:05:37 +01:00
|
|
|
doFetchUserMemberships,
|
2022-03-25 08:53:04 +01:00
|
|
|
doResolveClaimIds,
|
|
|
|
doResolveUris,
|
2019-06-11 20:10:58 +02:00
|
|
|
};
|
|
|
|
|
2020-04-15 18:43:22 +02:00
|
|
|
export default connect(select, perform)(ClaimListDiscover);
|