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

37 lines
1.4 KiB
JavaScript
Raw Normal View History

import { connect } from 'react-redux';
2017-05-12 18:50:51 -04:00
import {
makeSelectClaimIsMine,
2019-05-06 22:35:04 -04:00
makeSelectTitleForUri,
makeSelectThumbnailForUri,
makeSelectCoverForUri,
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';
import { selectChannelIsBlocked } from 'redux/selectors/blocked';
import { selectBlackListedOutpoints, doFetchSubCount, makeSelectSubCountForUri } from 'lbryinc';
import { makeSelectIsSubscribed } from 'redux/selectors/subscriptions';
2020-06-29 15:54:07 -04:00
import { doOpenModal } from 'redux/actions/app';
import ChannelPage from './view';
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),
channelIsMine: makeSelectClaimIsMine(props.uri)(state),
page: selectCurrentChannelPage(state),
2019-07-17 16:49:06 -04: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),
2020-06-21 12:51:06 -04:00
pending: makeSelectClaimIsPending(props.uri)(state),
});
const perform = dispatch => ({
2020-06-29 15:54:07 -04:00
openModal: (modal, props) => dispatch(doOpenModal(modal, props)),
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);