2017-12-21 22:08:54 +01:00
|
|
|
import { connect } from 'react-redux';
|
2020-03-31 22:30:56 +02: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-03-31 22:30:56 +02: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-31 22:30:56 +02: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),
|
2020-03-31 22:30:56 +02:00
|
|
|
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-31 22:30:56 +02:00
|
|
|
doResolveUri,
|
|
|
|
})(Tags);
|