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

49 lines
1.9 KiB
JavaScript
Raw Normal View History

import { connect } from 'react-redux';
2017-05-13 00:50:51 +02:00
import {
selectClaimIsMine,
selectTitleForUri,
getThumbnailFromClaim,
2019-05-07 04:35:04 +02:00
makeSelectCoverForUri,
selectCurrentChannelPage,
selectClaimForUri,
2020-06-21 18:51:06 +02:00
makeSelectClaimIsPending,
} from 'redux/selectors/claims';
import { selectMyUnpublishedCollections } from 'redux/selectors/collections';
import { selectBlacklistedOutpointMap, doFetchSubCount, selectSubCountForUri } from 'lbryinc';
2020-09-03 22:05:38 +02:00
import { selectYoutubeChannels } from 'redux/selectors/user';
import { selectIsSubscribedForUri } from 'redux/selectors/subscriptions';
import { selectModerationBlockList } from 'redux/selectors/comments';
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';
import ChannelPage from './view';
const select = (state, props) => {
const claim = selectClaimForUri(state, props.uri);
return {
title: selectTitleForUri(state, props.uri),
thumbnail: getThumbnailFromClaim(claim),
cover: makeSelectCoverForUri(props.uri)(state),
channelIsMine: selectClaimIsMine(state, claim),
page: selectCurrentChannelPage(state),
claim,
isSubscribed: selectIsSubscribedForUri(state, props.uri),
blackListedOutpointMap: selectBlacklistedOutpointMap(state),
subCount: selectSubCountForUri(state, props.uri),
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),
};
};
const perform = (dispatch) => ({
2020-06-29 21:54:07 +02:00
openModal: (modal, props) => dispatch(doOpenModal(modal, props)),
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);