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

22 lines
705 B
JavaScript
Raw Normal View History

import { connect } from 'react-redux';
import { makeSelectClaimForUri, selectFollowedTags, doResolveUri } from 'lbry-redux';
import { doToggleTagFollowDesktop } from 'redux/actions/tags';
import * as CS from 'constants/claim_search';
2020-02-26 20:14:10 +01:00
import Tags from './view';
2017-04-23 11:56:50 +02:00
const select = (state, props) => {
const urlParams = new URLSearchParams(props.location.search);
const repostedUri = decodeURIComponent(urlParams.get(CS.REPOSTED_URI_KEY));
2017-04-23 11:56:50 +02:00
return {
followedTags: selectFollowedTags(state),
repostedUri: repostedUri,
repostedClaim: repostedUri ? makeSelectClaimForUri(repostedUri)(state) : null,
};
};
export default connect(select, {
doToggleTagFollowDesktop,
doResolveUri,
})(Tags);