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

25 lines
711 B
JavaScript
Raw Normal View History

2017-06-06 23:19:12 +02:00
import React from "react";
import { connect } from "react-redux";
import { doResolveUri } from "actions/content";
import { makeSelectClaimForUri } from "selectors/claims";
import { makeSelectIsResolvingForUri } from "selectors/content";
import ShowPage from "./view";
2017-05-15 05:50:59 +02:00
const makeSelect = () => {
const selectClaim = makeSelectClaimForUri(),
2017-06-06 23:19:12 +02:00
selectIsResolving = makeSelectIsResolvingForUri();
2017-05-15 05:50:59 +02:00
const select = (state, props) => ({
2017-07-17 08:06:04 +02:00
claim: selectClaim(state, props.params),
isResolvingUri: selectIsResolving(state, props.params),
2017-06-06 23:19:12 +02:00
});
2017-05-15 05:50:59 +02:00
2017-06-06 23:19:12 +02:00
return select;
2017-06-06 06:21:55 +02:00
};
2017-06-06 06:21:55 +02:00
const perform = dispatch => ({
2017-06-06 23:19:12 +02:00
resolveUri: uri => dispatch(doResolveUri(uri)),
2017-06-06 06:21:55 +02:00
});
2017-06-06 06:21:55 +02:00
export default connect(makeSelect, perform)(ShowPage);