2017-12-21 18:08:54 -03:00
|
|
|
import { connect } from 'react-redux';
|
2017-05-12 18:50:51 -04:00
|
|
|
import {
|
2018-07-12 14:40:14 -04:00
|
|
|
makeSelectClaimIsMine,
|
2019-05-06 22:35:04 -04:00
|
|
|
makeSelectTitleForUri,
|
|
|
|
makeSelectThumbnailForUri,
|
|
|
|
makeSelectCoverForUri,
|
2019-05-14 01:12:24 -04:00
|
|
|
selectCurrentChannelPage,
|
2019-07-17 16:49:06 -04:00
|
|
|
makeSelectClaimForUri,
|
2020-06-21 12:51:06 -04:00
|
|
|
makeSelectClaimIsPending,
|
2018-04-18 00:03:01 -04:00
|
|
|
} from 'lbry-redux';
|
2020-07-15 09:50:08 -04:00
|
|
|
import { selectChannelIsBlocked } from 'redux/selectors/blocked';
|
2019-09-24 23:42:51 -04:00
|
|
|
import { selectBlackListedOutpoints, doFetchSubCount, makeSelectSubCountForUri } from 'lbryinc';
|
2019-07-08 16:54:58 -04:00
|
|
|
import { makeSelectIsSubscribed } from 'redux/selectors/subscriptions';
|
2020-06-29 15:54:07 -04:00
|
|
|
import { doOpenModal } from 'redux/actions/app';
|
2017-12-21 18:08:54 -03:00
|
|
|
import ChannelPage from './view';
|
2017-05-18 19:14:26 -04:00
|
|
|
|
2017-09-07 23:15:05 -04:00
|
|
|
const select = (state, props) => ({
|
2019-05-06 22:35:04 -04:00
|
|
|
title: makeSelectTitleForUri(props.uri)(state),
|
|
|
|
thumbnail: makeSelectThumbnailForUri(props.uri)(state),
|
|
|
|
cover: makeSelectCoverForUri(props.uri)(state),
|
2018-07-12 14:40:14 -04:00
|
|
|
channelIsMine: makeSelectClaimIsMine(props.uri)(state),
|
2019-05-14 01:12:24 -04:00
|
|
|
page: selectCurrentChannelPage(state),
|
2019-07-17 16:49:06 -04:00
|
|
|
claim: makeSelectClaimForUri(props.uri)(state),
|
2019-07-08 16:54:58 -04:00
|
|
|
isSubscribed: makeSelectIsSubscribed(props.uri, true)(state),
|
|
|
|
channelIsBlocked: selectChannelIsBlocked(props.uri)(state),
|
2019-08-28 21:39:21 -04:00
|
|
|
blackListedOutpoints: selectBlackListedOutpoints(state),
|
2019-09-24 23:42:51 -04:00
|
|
|
subCount: makeSelectSubCountForUri(props.uri)(state),
|
2020-06-21 12:51:06 -04:00
|
|
|
pending: makeSelectClaimIsPending(props.uri)(state),
|
2019-08-30 12:56:35 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
const perform = dispatch => ({
|
2020-06-29 15:54:07 -04:00
|
|
|
openModal: (modal, props) => dispatch(doOpenModal(modal, props)),
|
2019-09-24 23:42:51 -04:00
|
|
|
fetchSubCount: claimId => dispatch(doFetchSubCount(claimId)),
|
2017-09-07 23:15:05 -04:00
|
|
|
});
|
2017-05-03 23:44:08 -04:00
|
|
|
|
2020-06-08 14:42:29 -04:00
|
|
|
export default connect(select, perform)(ChannelPage);
|