2017-12-21 22:08:54 +01:00
|
|
|
import { connect } from 'react-redux';
|
2017-05-13 00:50:51 +02:00
|
|
|
import {
|
2018-07-12 20:40:14 +02:00
|
|
|
makeSelectClaimIsMine,
|
2019-05-07 04:35:04 +02:00
|
|
|
makeSelectTitleForUri,
|
|
|
|
makeSelectThumbnailForUri,
|
|
|
|
makeSelectCoverForUri,
|
2019-05-14 07:12:24 +02:00
|
|
|
selectCurrentChannelPage,
|
2019-07-17 22:49:06 +02:00
|
|
|
makeSelectClaimForUri,
|
2019-07-08 22:54:58 +02:00
|
|
|
selectChannelIsBlocked,
|
2018-04-18 06:03:01 +02:00
|
|
|
} from 'lbry-redux';
|
2019-09-25 05:42:51 +02:00
|
|
|
import { selectBlackListedOutpoints, doFetchSubCount, makeSelectSubCountForUri } from 'lbryinc';
|
2019-07-08 22:54:58 +02:00
|
|
|
import { makeSelectIsSubscribed } from 'redux/selectors/subscriptions';
|
2017-12-21 22:08:54 +01:00
|
|
|
import ChannelPage from './view';
|
2017-05-19 01:14:26 +02:00
|
|
|
|
2017-09-08 05:15:05 +02:00
|
|
|
const select = (state, props) => ({
|
2019-05-07 04:35:04 +02:00
|
|
|
title: makeSelectTitleForUri(props.uri)(state),
|
|
|
|
thumbnail: makeSelectThumbnailForUri(props.uri)(state),
|
|
|
|
cover: makeSelectCoverForUri(props.uri)(state),
|
2018-07-12 20:40:14 +02:00
|
|
|
channelIsMine: makeSelectClaimIsMine(props.uri)(state),
|
2019-05-14 07:12:24 +02:00
|
|
|
page: selectCurrentChannelPage(state),
|
2019-07-17 22:49:06 +02:00
|
|
|
claim: makeSelectClaimForUri(props.uri)(state),
|
2019-07-08 22:54:58 +02:00
|
|
|
isSubscribed: makeSelectIsSubscribed(props.uri, true)(state),
|
|
|
|
channelIsBlocked: selectChannelIsBlocked(props.uri)(state),
|
2019-08-29 03:39:21 +02:00
|
|
|
blackListedOutpoints: selectBlackListedOutpoints(state),
|
2019-09-25 05:42:51 +02:00
|
|
|
subCount: makeSelectSubCountForUri(props.uri)(state),
|
2019-08-30 18:56:35 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
const perform = dispatch => ({
|
2019-09-25 05:42:51 +02: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);
|