2019-07-09 02:54:32 +02:00
|
|
|
import { connect } from 'react-redux';
|
2019-08-15 05:55:01 +02:00
|
|
|
import { doClaimSearch, doFileList, selectBalance, selectFileInfosDownloaded, selectFollowedTags } from 'lbry-redux';
|
2019-07-09 02:54:32 +02:00
|
|
|
import {
|
|
|
|
doFetchFeaturedUris,
|
|
|
|
doFetchRewardedContent,
|
|
|
|
doFetchMySubscriptions,
|
|
|
|
doRemoveUnreadSubscriptions,
|
|
|
|
selectEnabledChannelNotifications,
|
|
|
|
selectFeaturedUris,
|
|
|
|
selectFetchingFeaturedUris,
|
|
|
|
selectSubscriptionClaims,
|
|
|
|
selectUnreadSubscriptions,
|
|
|
|
} from 'lbryinc';
|
2019-09-25 15:44:33 +02:00
|
|
|
import { doPushDrawerStack } from 'redux/actions/drawer';
|
2019-08-20 10:03:33 +02:00
|
|
|
import { doSetClientSetting, doSetSortByItem, doSetTimeItem } from 'redux/actions/settings';
|
|
|
|
import { makeSelectClientSetting, selectSortByItem, selectTimeItem } from 'redux/selectors/settings';
|
2019-07-26 10:13:46 +02:00
|
|
|
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
|
2019-07-09 02:54:32 +02:00
|
|
|
import DiscoverPage from './view';
|
|
|
|
|
|
|
|
const select = state => ({
|
|
|
|
allSubscriptions: selectSubscriptionClaims(state),
|
|
|
|
balance: selectBalance(state),
|
|
|
|
enabledChannelNotifications: selectEnabledChannelNotifications(state),
|
|
|
|
featuredUris: selectFeaturedUris(state),
|
|
|
|
fetchingFeaturedUris: selectFetchingFeaturedUris(state),
|
|
|
|
fileInfos: selectFileInfosDownloaded(state),
|
2019-07-26 10:13:46 +02:00
|
|
|
followedTags: selectFollowedTags(state),
|
2019-07-09 02:54:32 +02:00
|
|
|
ratingReminderDisabled: makeSelectClientSetting(Constants.SETTING_RATING_REMINDER_DISABLED)(state),
|
|
|
|
ratingReminderLastShown: makeSelectClientSetting(Constants.SETTING_RATING_REMINDER_LAST_SHOWN)(state),
|
2019-08-10 08:55:12 +02:00
|
|
|
sortByItem: selectSortByItem(state),
|
2019-08-20 10:03:33 +02:00
|
|
|
timeItem: selectTimeItem(state),
|
2019-07-09 02:54:32 +02:00
|
|
|
unreadSubscriptions: selectUnreadSubscriptions(state),
|
|
|
|
});
|
|
|
|
|
|
|
|
const perform = dispatch => ({
|
2019-07-26 10:13:46 +02:00
|
|
|
doClaimSearch,
|
2019-07-09 02:54:32 +02:00
|
|
|
fetchFeaturedUris: () => dispatch(doFetchFeaturedUris()),
|
|
|
|
fetchRewardedContent: () => dispatch(doFetchRewardedContent()),
|
|
|
|
fetchSubscriptions: () => dispatch(doFetchMySubscriptions()),
|
|
|
|
fileList: () => dispatch(doFileList()),
|
2019-09-25 15:44:33 +02:00
|
|
|
pushDrawerStack: () => dispatch(doPushDrawerStack(Constants.DRAWER_ROUTE_DISCOVER)),
|
2019-07-09 02:54:32 +02:00
|
|
|
removeUnreadSubscriptions: () => dispatch(doRemoveUnreadSubscriptions()),
|
|
|
|
setClientSetting: (key, value) => dispatch(doSetClientSetting(key, value)),
|
2019-08-10 08:55:12 +02:00
|
|
|
setSortByItem: item => dispatch(doSetSortByItem(item)),
|
2019-08-20 10:03:33 +02:00
|
|
|
setTimeItem: item => dispatch(doSetTimeItem(item)),
|
2019-07-09 02:54:32 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
export default connect(
|
|
|
|
select,
|
|
|
|
perform
|
|
|
|
)(DiscoverPage);
|