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

25 lines
684 B
JavaScript
Raw Normal View History

2017-06-06 06:21:55 +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 = () => {
2017-06-06 06:21:55 +02:00
const selectClaim = makeSelectClaimForUri(),
selectIsResolving = makeSelectIsResolvingForUri();
2017-05-15 05:50:59 +02:00
2017-06-06 06:21:55 +02:00
const select = (state, props) => ({
claim: selectClaim(state, props),
isResolvingUri: selectIsResolving(state, props)
});
2017-05-15 05:50:59 +02:00
2017-06-06 06:21:55 +02:00
return select;
};
2017-06-06 06:21:55 +02:00
const perform = dispatch => ({
resolveUri: uri => dispatch(doResolveUri(uri))
});
2017-06-06 06:21:55 +02:00
export default connect(makeSelect, perform)(ShowPage);