2017-10-10 01:19:50 +02:00
|
|
|
import React from "react";
|
|
|
|
import { connect } from "react-redux";
|
|
|
|
import { makeSelectClaimForUri } from "selectors/claims";
|
|
|
|
import { doNavigate } from "actions/navigation";
|
2017-10-12 15:37:24 +02:00
|
|
|
import { doResolveUri } from "actions/content";
|
2017-10-10 01:19:50 +02:00
|
|
|
import { makeSelectTotalItemsForChannel } from "selectors/content";
|
2017-10-12 15:37:24 +02:00
|
|
|
import { makeSelectIsUriResolving } from "selectors/content";
|
2017-10-10 01:19:50 +02:00
|
|
|
import ChannelTile from "./view";
|
|
|
|
|
|
|
|
const select = (state, props) => ({
|
|
|
|
claim: makeSelectClaimForUri(props.uri)(state),
|
2017-10-12 15:37:24 +02:00
|
|
|
isResolvingUri: makeSelectIsUriResolving(props.uri)(state),
|
2017-10-10 01:19:50 +02:00
|
|
|
totalItems: makeSelectTotalItemsForChannel(props.uri)(state),
|
|
|
|
});
|
|
|
|
|
|
|
|
const perform = dispatch => ({
|
|
|
|
navigate: (path, params) => dispatch(doNavigate(path, params)),
|
2017-10-12 15:37:24 +02:00
|
|
|
resolveUri: uri => dispatch(doResolveUri(uri)),
|
2017-10-10 01:19:50 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
export default connect(select, perform)(ChannelTile);
|