lbry-desktop/ui/js/component/uriIndicator/index.js
2017-09-07 23:15:05 -04:00

19 lines
632 B
JavaScript

import React from "react";
import lbryuri from "lbryuri";
import { connect } from "react-redux";
import { doResolveUri } from "actions/content";
import { makeSelectIsUriResolving } from "selectors/content";
import { makeSelectClaimForUri } from "selectors/claims";
import UriIndicator from "./view";
const select = (state, props) => ({
claim: makeSelectClaimForUri(props.uri)(state),
isResolvingUri: makeSelectIsUriResolving(props.uri)(state),
uri: lbryuri.normalize(props.uri),
});
const perform = dispatch => ({
resolveUri: uri => dispatch(doResolveUri(uri)),
});
export default connect(select, perform)(UriIndicator);