2020-08-21 17:49:13 +02:00
|
|
|
import * as CS from 'constants/claim_search';
|
2017-12-21 22:08:54 +01:00
|
|
|
import { connect } from 'react-redux';
|
2021-10-08 05:47:39 +02:00
|
|
|
import { doResolveUri } from 'redux/actions/claims';
|
2021-12-31 18:52:26 +01:00
|
|
|
import { selectClaimForUri } from 'redux/selectors/claims';
|
2021-10-08 05:47:39 +02:00
|
|
|
import * as SETTINGS from 'constants/settings';
|
2020-10-05 20:31:51 +02:00
|
|
|
import { selectFollowedTags } from 'redux/selectors/tags';
|
2020-03-10 00:46:37 +01:00
|
|
|
import { doToggleTagFollowDesktop } from 'redux/actions/tags';
|
2020-08-21 17:49:13 +02:00
|
|
|
import { makeSelectClientSetting } from 'redux/selectors/settings';
|
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,
|
2021-12-31 18:52:26 +01:00
|
|
|
repostedClaim: repostedUri ? selectClaimForUri(state, repostedUri) : null,
|
2020-08-21 17:49:13 +02:00
|
|
|
tileLayout: makeSelectClientSetting(SETTINGS.TILE_LAYOUT)(state),
|
2020-03-19 17:54:37 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
export default connect(select, {
|
|
|
|
doToggleTagFollowDesktop,
|
2020-03-31 22:30:56 +02:00
|
|
|
doResolveUri,
|
|
|
|
})(Tags);
|