lbry-desktop/ui/component/uriIndicator/index.js
mayeaux fb3a73d8a7
Membership subscriptions (#812)
Enter: Odysee Premium.
2022-03-09 13:05:37 -05:00

25 lines
747 B
JavaScript

import { connect } from 'react-redux';
import { normalizeURI } from 'util/lbryURI';
import { doResolveUri } from 'redux/actions/claims';
import { selectIsUriResolving, selectClaimForUri, selectOdyseeMembershipForUri } from 'redux/selectors/claims';
import UriIndicator from './view';
const select = (state, props) => {
let uri = null;
try {
uri = normalizeURI(props.uri);
} catch {}
return {
claim: selectClaimForUri(state, props.uri),
isResolvingUri: selectIsUriResolving(state, props.uri),
uri,
odyseeMembership: selectOdyseeMembershipForUri(state, props.uri),
};
};
const perform = (dispatch) => ({
resolveUri: (uri) => dispatch(doResolveUri(uri)),
});
export default connect(select, perform)(UriIndicator);