2017-12-21 22:08:54 +01:00
|
|
|
import { connect } from 'react-redux';
|
2020-03-24 17:31:23 +01:00
|
|
|
import { makeSelectClaimForUri, selectFollowedTags, doResolveUri } from 'lbry-redux';
|
2020-03-26 22:47:07 +01:00
|
|
|
import { selectUserVerifiedEmail } from 'lbryinc';
|
2020-03-10 00:46:37 +01:00
|
|
|
import { doToggleTagFollowDesktop } from 'redux/actions/tags';
|
2020-03-19 17:54:37 +01:00
|
|
|
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
|
|
|
|
2020-03-19 17:54:37 +01:00
|
|
|
const select = (state, props) => {
|
|
|
|
const urlParams = new URLSearchParams(props.location.search);
|
2020-03-24 19:49:42 +01:00
|
|
|
const repostedUriInUrl = urlParams.get(CS.REPOSTED_URI_KEY);
|
|
|
|
const repostedUri = repostedUriInUrl ? decodeURIComponent(repostedUriInUrl) : undefined;
|
2017-04-23 11:56:50 +02:00
|
|
|
|
2020-03-19 17:54:37 +01:00
|
|
|
return {
|
|
|
|
followedTags: selectFollowedTags(state),
|
|
|
|
repostedUri: repostedUri,
|
|
|
|
repostedClaim: repostedUri ? makeSelectClaimForUri(repostedUri)(state) : null,
|
2020-03-26 22:47:07 +01:00
|
|
|
isAuthenticated: selectUserVerifiedEmail(state),
|
2020-03-19 17:54:37 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
export default connect(select, {
|
|
|
|
doToggleTagFollowDesktop,
|
2020-03-24 17:31:23 +01:00
|
|
|
doResolveUri,
|
2020-03-19 17:54:37 +01:00
|
|
|
})(Tags);
|