lbry-desktop/ui/component/socialShare/index.js

34 lines
1.1 KiB
JavaScript
Raw Normal View History

2018-09-12 18:42:15 +02:00
import { connect } from 'react-redux';
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';
import { selectUserInviteReferralCode, selectUser, selectUserInviteStatusFetched } from 'redux/selectors/user';
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 {
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
const perform = {
doFetchInviteStatus,
};
export default connect(select, perform)(SocialShare);