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

25 lines
885 B
JavaScript
Raw Normal View History

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