2018-09-12 18:42:15 +02:00
|
|
|
import { connect } from 'react-redux';
|
2022-01-21 11:11:42 +01:00
|
|
|
import { doFetchInviteStatus } from 'redux/actions/user';
|
2022-05-19 23:39:09 +02:00
|
|
|
import {
|
|
|
|
selectClaimForUri,
|
|
|
|
selectTitleForUri,
|
|
|
|
makeSelectTagInClaimOrChannelForUri,
|
|
|
|
selectClaimIsNsfwForUri,
|
|
|
|
} from 'redux/selectors/claims';
|
2018-09-12 18:42:15 +02:00
|
|
|
import SocialShare from './view';
|
2022-01-21 11:11:42 +01:00
|
|
|
import { selectUserInviteReferralCode, selectUser, selectUserInviteStatusFetched } from 'redux/selectors/user';
|
2022-04-01 10:18:51 +02:00
|
|
|
import { selectContentPositionForUri } from 'redux/selectors/content';
|
2022-05-19 23:39:09 +02:00
|
|
|
import { DISABLE_DOWNLOAD_BUTTON_TAG } from 'constants/tags';
|
2018-09-12 18:42:15 +02:00
|
|
|
|
2022-05-13 14:04:26 +02:00
|
|
|
const select = (state, props) => {
|
|
|
|
const { uri } = props;
|
|
|
|
|
|
|
|
return {
|
2022-05-13 18:46:49 +02:00
|
|
|
claim: selectClaimForUri(state, uri),
|
2022-05-13 14:04:26 +02:00
|
|
|
inviteStatusFetched: selectUserInviteStatusFetched(state),
|
|
|
|
referralCode: selectUserInviteReferralCode(state),
|
|
|
|
user: selectUser(state),
|
|
|
|
title: selectTitleForUri(state, uri),
|
|
|
|
position: selectContentPositionForUri(state, uri),
|
2022-05-19 23:39:09 +02:00
|
|
|
disableDownloadButton: makeSelectTagInClaimOrChannelForUri(uri, DISABLE_DOWNLOAD_BUTTON_TAG)(state),
|
|
|
|
isMature: selectClaimIsNsfwForUri(state, uri),
|
2022-05-13 14:04:26 +02:00
|
|
|
};
|
|
|
|
};
|
2018-09-12 18:42:15 +02:00
|
|
|
|
2022-01-21 11:11:42 +01:00
|
|
|
const perform = {
|
|
|
|
doFetchInviteStatus,
|
|
|
|
};
|
|
|
|
|
|
|
|
export default connect(select, perform)(SocialShare);
|