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

29 lines
974 B
JavaScript
Raw Normal View History

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';
import { doFetchPersonalRecommendations } from 'redux/actions/search';
2022-03-17 01:23:16 +01:00
import { doSetClientSetting } from 'redux/actions/settings';
import { selectPersonalRecommendations } from 'redux/selectors/search';
2022-03-17 01:23:16 +01:00
import { selectClientSetting } from 'redux/selectors/settings';
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),
};
};
const perform = {
doFetchPersonalRecommendations,
2022-03-17 01:23:16 +01:00
doSetClientSetting,
doToast,
};
export default connect(select, perform)(RecommendedPersonal);