2022-03-15 20:07:31 +01:00
|
|
|
import { connect } from 'react-redux';
|
2022-03-17 01:23:16 +01:00
|
|
|
import * as SETTINGS from 'constants/settings';
|
|
|
|
import { doToast } from 'redux/actions/notifications';
|
2022-03-15 20:07:31 +01:00
|
|
|
import { doFetchPersonalRecommendations } from 'redux/actions/search';
|
2022-03-17 01:23:16 +01:00
|
|
|
import { doSetClientSetting } from 'redux/actions/settings';
|
2022-03-15 20:07:31 +01:00
|
|
|
import { selectPersonalRecommendations } from 'redux/selectors/search';
|
2022-03-17 01:23:16 +01:00
|
|
|
import { selectClientSetting } from 'redux/selectors/settings';
|
2022-03-15 20:07:31 +01:00
|
|
|
import { selectHasOdyseeMembership, selectUser } from 'redux/selectors/user';
|
|
|
|
|
|
|
|
import RecommendedPersonal from './view';
|
|
|
|
|
|
|
|
const select = (state) => {
|
|
|
|
const user = selectUser(state);
|
|
|
|
return {
|
|
|
|
userId: user && user.id,
|
|
|
|
personalRecommendations: selectPersonalRecommendations(state),
|
|
|
|
hasMembership: selectHasOdyseeMembership(state),
|
2022-03-17 01:23:16 +01:00
|
|
|
hideFyp: selectClientSetting(state, SETTINGS.HIDE_FYP),
|
2022-03-15 20:07:31 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
const perform = {
|
|
|
|
doFetchPersonalRecommendations,
|
2022-03-17 01:23:16 +01:00
|
|
|
doSetClientSetting,
|
|
|
|
doToast,
|
2022-03-15 20:07:31 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
export default connect(select, perform)(RecommendedPersonal);
|