2022-05-31 11:19:21 +02:00
|
|
|
import { connect } from 'react-redux';
|
2022-06-02 15:56:12 +02:00
|
|
|
import AdsSticky from './view';
|
2022-05-31 11:19:21 +02:00
|
|
|
import { doSetAdBlockerFound } from 'redux/actions/app';
|
2022-06-02 15:56:12 +02:00
|
|
|
import { selectClaimForUri } from 'redux/selectors/claims';
|
2022-05-31 11:19:21 +02:00
|
|
|
import { selectAdBlockerFound } from 'redux/selectors/app';
|
2022-06-01 15:47:14 +02:00
|
|
|
import { selectHomepageData } from 'redux/selectors/settings';
|
2022-06-02 15:56:12 +02:00
|
|
|
import { selectOdyseeMembershipIsPremiumPlus, selectUserCountry, selectUserVerifiedEmail } from 'redux/selectors/user';
|
|
|
|
import { isChannelClaim, isStreamPlaceholderClaim } from 'util/claim';
|
2022-05-31 11:19:21 +02:00
|
|
|
|
2022-06-02 15:56:12 +02:00
|
|
|
const select = (state, props) => {
|
|
|
|
const claim = selectClaimForUri(state, props.uri);
|
|
|
|
|
|
|
|
return {
|
|
|
|
isContentClaim: isStreamPlaceholderClaim(claim) || Boolean(claim?.value?.source?.media_type),
|
|
|
|
isChannelClaim: isChannelClaim(claim),
|
|
|
|
authenticated: selectUserVerifiedEmail(state),
|
|
|
|
isAdBlockerFound: selectAdBlockerFound(state),
|
|
|
|
userHasPremiumPlus: selectOdyseeMembershipIsPremiumPlus(state),
|
|
|
|
userCountry: selectUserCountry(state),
|
|
|
|
homepageData: selectHomepageData(state),
|
|
|
|
};
|
|
|
|
};
|
2022-05-31 11:19:21 +02:00
|
|
|
|
|
|
|
const perform = {
|
|
|
|
doSetAdBlockerFound,
|
|
|
|
};
|
|
|
|
|
|
|
|
export default connect(select, perform)(AdsSticky);
|