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

23 lines
598 B
JavaScript
Raw Normal View History

import { connect } from 'react-redux';
import EmbedWrapperPage from './view';
2020-01-27 22:37:54 +01:00
import { doResolveUri, makeSelectClaimForUri, buildURI } from 'lbry-redux';
const select = (state, props) => {
const { match } = props;
const { params } = match;
const { claimName, claimId } = params;
2020-01-27 22:37:54 +01:00
const uri = claimName && claimId ? buildURI({ claimName, claimId }) : '';
return {
uri,
claim: makeSelectClaimForUri(uri)(state),
};
};
2020-01-31 20:33:40 +01:00
const perform = dispatch => {
return {
resolveUri: uri => dispatch(doResolveUri(uri)),
};
};
2020-04-14 01:48:11 +02:00
export default connect(select, perform)(EmbedWrapperPage);