2020-01-27 19:52:25 +01:00
|
|
|
import * as SETTINGS from 'constants/settings';
|
|
|
|
import { connect } from 'react-redux';
|
|
|
|
import { makeSelectClaimForUri } from 'lbry-redux';
|
|
|
|
import { makeSelectNextUnplayedRecommended } from 'redux/selectors/content';
|
|
|
|
import { makeSelectClientSetting } from 'redux/selectors/settings';
|
2020-01-27 20:32:20 +01:00
|
|
|
import { doSetPlayingUri } from 'redux/actions/content';
|
2020-01-27 19:52:25 +01:00
|
|
|
import RecommendedVideos from './view';
|
|
|
|
|
|
|
|
const select = (state, props) => {
|
|
|
|
const nextRecommendedUri = makeSelectNextUnplayedRecommended(props.uri)(state);
|
|
|
|
return {
|
|
|
|
nextRecommendedUri,
|
|
|
|
nextRecommendedClaim: makeSelectClaimForUri(nextRecommendedUri)(state),
|
|
|
|
autoplay: makeSelectClientSetting(SETTINGS.AUTOPLAY)(state),
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2020-01-27 20:32:20 +01:00
|
|
|
const perform = dispatch => ({
|
|
|
|
setPlayingUri: uri => dispatch(doSetPlayingUri(uri)),
|
|
|
|
});
|
2020-01-27 19:52:25 +01:00
|
|
|
|
|
|
|
export default connect(
|
|
|
|
select,
|
|
|
|
perform
|
|
|
|
)(RecommendedVideos);
|