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

28 lines
722 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';
2020-01-31 20:33:40 +01:00
import { doAnalyticsView } from 'redux/actions/app';
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)),
triggerAnalyticsView: uri => dispatch(doAnalyticsView(uri)),
};
};
export default connect(
select,
perform
)(EmbedWrapperPage);