2017-12-21 22:08:54 +01:00
|
|
|
import { connect } from 'react-redux';
|
2017-05-13 00:50:51 +02:00
|
|
|
import {
|
2021-11-11 05:48:10 +01:00
|
|
|
selectClaimIsMine,
|
2021-11-16 05:23:18 +01:00
|
|
|
selectTitleForUri,
|
2019-05-07 04:35:04 +02:00
|
|
|
makeSelectCoverForUri,
|
2019-05-14 07:12:24 +02:00
|
|
|
selectCurrentChannelPage,
|
2021-11-11 05:48:10 +01:00
|
|
|
selectClaimForUri,
|
2020-06-21 18:51:06 +02:00
|
|
|
makeSelectClaimIsPending,
|
2022-06-13 12:53:58 +02:00
|
|
|
selectOdyseeMembershipForChannelId,
|
2021-10-17 10:36:14 +02:00
|
|
|
} from 'redux/selectors/claims';
|
|
|
|
import { selectMyUnpublishedCollections } from 'redux/selectors/collections';
|
2021-12-01 16:24:27 +01:00
|
|
|
import { selectBlacklistedOutpointMap, doFetchSubCount, selectSubCountForUri } from 'lbryinc';
|
2020-09-03 22:05:38 +02:00
|
|
|
import { selectYoutubeChannels } from 'redux/selectors/user';
|
2021-11-12 15:47:07 +01:00
|
|
|
import { selectIsSubscribedForUri } from 'redux/selectors/subscriptions';
|
2021-03-03 19:50:16 +01:00
|
|
|
import { selectModerationBlockList } from 'redux/selectors/comments';
|
2021-03-04 18:55:16 +01:00
|
|
|
import { selectMutedChannels } from 'redux/selectors/blocked';
|
2020-06-29 21:54:07 +02:00
|
|
|
import { doOpenModal } from 'redux/actions/app';
|
2022-01-18 19:30:43 +01:00
|
|
|
import { selectLanguage } from 'redux/selectors/settings';
|
2022-03-15 17:28:55 +01:00
|
|
|
import { getThumbnailFromClaim } from 'util/claim';
|
2017-12-21 22:08:54 +01:00
|
|
|
import ChannelPage from './view';
|
2017-05-19 01:14:26 +02:00
|
|
|
|
2021-11-11 05:48:10 +01:00
|
|
|
const select = (state, props) => {
|
|
|
|
const claim = selectClaimForUri(state, props.uri);
|
|
|
|
|
|
|
|
return {
|
2021-11-16 05:23:18 +01:00
|
|
|
title: selectTitleForUri(state, props.uri),
|
2021-11-12 16:59:11 +01:00
|
|
|
thumbnail: getThumbnailFromClaim(claim),
|
2021-11-11 05:48:10 +01:00
|
|
|
cover: makeSelectCoverForUri(props.uri)(state),
|
|
|
|
channelIsMine: selectClaimIsMine(state, claim),
|
|
|
|
page: selectCurrentChannelPage(state),
|
|
|
|
claim,
|
2021-11-12 15:47:07 +01:00
|
|
|
isSubscribed: selectIsSubscribedForUri(state, props.uri),
|
2021-12-01 16:24:27 +01:00
|
|
|
blackListedOutpointMap: selectBlacklistedOutpointMap(state),
|
2021-11-15 15:08:23 +01:00
|
|
|
subCount: selectSubCountForUri(state, props.uri),
|
2021-11-11 05:48:10 +01:00
|
|
|
pending: makeSelectClaimIsPending(props.uri)(state),
|
|
|
|
youtubeChannels: selectYoutubeChannels(state),
|
|
|
|
blockedChannels: selectModerationBlockList(state),
|
|
|
|
mutedChannels: selectMutedChannels(state),
|
|
|
|
unpublishedCollections: selectMyUnpublishedCollections(state),
|
2022-01-18 19:30:43 +01:00
|
|
|
lang: selectLanguage(state),
|
2022-06-13 12:53:58 +02:00
|
|
|
odyseeMembership: selectOdyseeMembershipForChannelId(state, claim.claim_id),
|
2021-11-11 05:48:10 +01:00
|
|
|
};
|
|
|
|
};
|
2019-08-30 18:56:35 +02:00
|
|
|
|
2021-03-03 19:50:16 +01:00
|
|
|
const perform = (dispatch) => ({
|
2020-06-29 21:54:07 +02:00
|
|
|
openModal: (modal, props) => dispatch(doOpenModal(modal, props)),
|
2021-03-03 19:50:16 +01:00
|
|
|
fetchSubCount: (claimId) => dispatch(doFetchSubCount(claimId)),
|
2017-09-08 05:15:05 +02:00
|
|
|
});
|
2017-05-04 05:44:08 +02:00
|
|
|
|
2020-06-08 20:42:29 +02:00
|
|
|
export default connect(select, perform)(ChannelPage);
|