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

33 lines
1.2 KiB
JavaScript
Raw Normal View History

import { connect } from 'react-redux';
2017-05-13 00:50:51 +02:00
import {
makeSelectClaimIsMine,
2019-05-07 04:35:04 +02:00
makeSelectTitleForUri,
makeSelectThumbnailForUri,
makeSelectCoverForUri,
selectCurrentChannelPage,
2019-07-17 22:49:06 +02:00
makeSelectClaimForUri,
selectChannelIsBlocked,
2018-04-18 06:03:01 +02:00
} from 'lbry-redux';
import { selectBlackListedOutpoints, doFetchSubCount, makeSelectSubCountForUri } from 'lbryinc';
import { makeSelectIsSubscribed } from 'redux/selectors/subscriptions';
import ChannelPage from './view';
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),
channelIsMine: makeSelectClaimIsMine(props.uri)(state),
page: selectCurrentChannelPage(state),
2019-07-17 22:49:06 +02:00
claim: makeSelectClaimForUri(props.uri)(state),
isSubscribed: makeSelectIsSubscribed(props.uri, true)(state),
channelIsBlocked: selectChannelIsBlocked(props.uri)(state),
blackListedOutpoints: selectBlackListedOutpoints(state),
subCount: makeSelectSubCountForUri(props.uri)(state),
});
const perform = dispatch => ({
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);