2017-06-06 23:19:12 +02:00
|
|
|
import React from "react";
|
|
|
|
import { connect } from "react-redux";
|
|
|
|
import { doFetchClaimsByChannel } from "actions/content";
|
2017-05-13 00:50:51 +02:00
|
|
|
import {
|
2017-05-19 01:14:26 +02:00
|
|
|
makeSelectClaimForUri,
|
2017-06-06 23:19:12 +02:00
|
|
|
makeSelectClaimsInChannelForUri,
|
|
|
|
} from "selectors/claims";
|
|
|
|
import ChannelPage from "./view";
|
2017-05-19 01:14:26 +02:00
|
|
|
|
|
|
|
const makeSelect = () => {
|
|
|
|
const selectClaim = makeSelectClaimForUri(),
|
2017-06-06 23:19:12 +02:00
|
|
|
selectClaimsInChannel = makeSelectClaimsInChannelForUri();
|
2017-05-19 01:14:26 +02:00
|
|
|
|
|
|
|
const select = (state, props) => ({
|
|
|
|
claim: selectClaim(state, props),
|
2017-06-06 23:19:12 +02:00
|
|
|
claimsInChannel: selectClaimsInChannel(state, props),
|
|
|
|
});
|
2017-05-19 01:14:26 +02:00
|
|
|
|
2017-06-06 23:19:12 +02:00
|
|
|
return select;
|
2017-06-06 06:21:55 +02:00
|
|
|
};
|
2017-05-04 05:44:08 +02:00
|
|
|
|
2017-06-06 06:21:55 +02:00
|
|
|
const perform = dispatch => ({
|
2017-06-06 23:19:12 +02:00
|
|
|
fetchClaims: uri => dispatch(doFetchClaimsByChannel(uri)),
|
2017-06-06 06:21:55 +02:00
|
|
|
});
|
2017-05-04 05:44:08 +02:00
|
|
|
|
2017-06-06 06:21:55 +02:00
|
|
|
export default connect(makeSelect, perform)(ChannelPage);
|