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

31 lines
1 KiB
JavaScript
Raw Normal View History

import { connect } from 'react-redux';
import { doFetchClaimsByChannel } from 'redux/actions/content';
2018-11-03 03:17:55 +01:00
import { PAGE_SIZE } from 'constants/claim';
2017-05-13 00:50:51 +02:00
import {
makeSelectClaimForUri,
2019-03-28 17:53:13 +01:00
makeSelectClaimsInChannelForCurrentPageState,
2017-07-17 08:06:04 +02:00
makeSelectFetchingChannelClaims,
makeSelectClaimIsMine,
2018-11-03 03:17:55 +01:00
makeSelectTotalPagesForChannel,
2018-04-18 06:03:01 +02:00
} from 'lbry-redux';
2018-11-20 17:09:19 +01:00
import { doOpenModal } from 'redux/actions/app';
import ChannelPage from './view';
2017-09-08 05:15:05 +02:00
const select = (state, props) => ({
claim: makeSelectClaimForUri(props.uri)(state),
2019-03-28 17:53:13 +01:00
claimsInChannel: makeSelectClaimsInChannelForCurrentPageState(props.uri)(state),
2017-09-08 05:15:05 +02:00
fetching: makeSelectFetchingChannelClaims(props.uri)(state),
2018-11-03 03:17:55 +01:00
totalPages: makeSelectTotalPagesForChannel(props.uri, PAGE_SIZE)(state),
channelIsMine: makeSelectClaimIsMine(props.uri)(state),
2017-09-08 05:15:05 +02:00
});
2017-05-04 05:44:08 +02:00
2017-06-06 06:21:55 +02:00
const perform = dispatch => ({
2017-07-17 08:06:04 +02:00
fetchClaims: (uri, page) => dispatch(doFetchClaimsByChannel(uri, page)),
2018-11-20 17:09:19 +01:00
openModal: (modal, props) => dispatch(doOpenModal(modal, props)),
2017-06-06 06:21:55 +02:00
});
2017-05-04 05:44:08 +02:00
export default connect(
select,
perform
)(ChannelPage);