2017-12-21 22:08:54 +01:00
|
|
|
import { connect } from 'react-redux';
|
2020-03-19 17:54:37 +01:00
|
|
|
import { makeSelectClaimForUri, selectFollowedTags } from 'lbry-redux';
|
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);
|
|
|
|
const repostedUri = decodeURIComponent(urlParams.get(CS.REPOSTED_URI_KEY));
|
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,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
export default connect(select, {
|
|
|
|
doToggleTagFollowDesktop,
|
|
|
|
})(Tags);
|