2018-07-25 02:50:04 +02:00
|
|
|
import { connect } from 'react-redux';
|
2021-04-08 17:21:45 +02:00
|
|
|
import { makeSelectClaimIsNsfw, makeSelectClaimForUri } from 'lbry-redux';
|
2021-03-19 16:04:12 +01:00
|
|
|
import { doFetchRecommendedContent } from 'redux/actions/search';
|
2020-07-27 22:04:12 +02:00
|
|
|
import { makeSelectRecommendedContentForUri, selectIsSearching } from 'redux/selectors/search';
|
2020-06-15 22:33:03 +02:00
|
|
|
import { selectUserVerifiedEmail } from 'redux/selectors/user';
|
2021-03-19 04:16:05 +01:00
|
|
|
import { makeSelectNextUnplayedRecommended } from 'redux/selectors/content';
|
2021-07-06 03:29:46 +02:00
|
|
|
import RecommendedContent from './view';
|
2018-07-25 02:50:04 +02:00
|
|
|
|
|
|
|
const select = (state, props) => ({
|
2020-01-28 23:05:44 +01:00
|
|
|
mature: makeSelectClaimIsNsfw(props.uri)(state),
|
2018-08-03 20:28:11 +02:00
|
|
|
recommendedContent: makeSelectRecommendedContentForUri(props.uri)(state),
|
2021-03-19 04:16:05 +01:00
|
|
|
nextRecommendedUri: makeSelectNextUnplayedRecommended(props.uri)(state),
|
2018-08-27 05:18:57 +02:00
|
|
|
isSearching: selectIsSearching(state),
|
2020-03-26 22:47:07 +01:00
|
|
|
isAuthenticated: selectUserVerifiedEmail(state),
|
2021-04-08 17:21:45 +02:00
|
|
|
claim: makeSelectClaimForUri(props.uri)(state),
|
2018-07-25 02:50:04 +02:00
|
|
|
});
|
|
|
|
|
2021-03-19 04:16:05 +01:00
|
|
|
const perform = (dispatch) => ({
|
2021-03-19 16:04:12 +01:00
|
|
|
doFetchRecommendedContent: (uri, mature) => dispatch(doFetchRecommendedContent(uri, mature)),
|
2018-07-25 02:50:04 +02:00
|
|
|
});
|
|
|
|
|
2021-07-06 03:29:46 +02:00
|
|
|
export default connect(select, perform)(RecommendedContent);
|