2017-12-21 22:08:54 +01:00
|
|
|
import { connect } from 'react-redux';
|
2018-11-27 16:49:54 +01:00
|
|
|
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 {
|
2017-05-19 01:14:26 +02:00
|
|
|
makeSelectClaimForUri,
|
2019-03-28 17:53:13 +01:00
|
|
|
makeSelectClaimsInChannelForCurrentPageState,
|
2017-07-17 08:06:04 +02:00
|
|
|
makeSelectFetchingChannelClaims,
|
2018-07-12 20:40:14 +02:00
|
|
|
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';
|
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) => ({
|
|
|
|
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),
|
2018-07-12 20:40:14 +02:00
|
|
|
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
|
|
|
|
2018-07-12 20:40:14 +02:00
|
|
|
export default connect(
|
|
|
|
select,
|
|
|
|
perform
|
|
|
|
)(ChannelPage);
|