2019-07-17 16:49:06 -04:00
|
|
|
import { connect } from 'react-redux';
|
2022-03-31 22:19:19 +08:00
|
|
|
import * as SETTINGS from 'constants/settings';
|
2020-06-15 16:33:03 -04:00
|
|
|
import { selectUserVerifiedEmail } from 'redux/selectors/user';
|
2022-03-29 14:45:59 +08:00
|
|
|
import { selectHasNavigated, selectScrollStartingPosition } from 'redux/selectors/app';
|
2022-03-31 22:19:19 +08:00
|
|
|
import { selectClientSetting, selectHomepageData, selectWildWestDisabled } from 'redux/selectors/settings';
|
2018-04-18 00:03:01 -04:00
|
|
|
import Router from './view';
|
2021-11-16 12:23:18 +08:00
|
|
|
import { selectTitleForUri } from 'redux/selectors/claims';
|
2022-05-10 09:01:19 -03:00
|
|
|
import { doSetHasNavigated, doSetActiveChannel } from 'redux/actions/app';
|
2020-10-06 20:59:38 -04:00
|
|
|
import { doUserSetReferrer } from 'redux/actions/user';
|
|
|
|
import { selectHasUnclaimedRefereeReward } from 'redux/selectors/rewards';
|
2022-03-22 15:03:39 -03:00
|
|
|
import { selectUnseenNotificationCount } from 'redux/selectors/notifications';
|
2020-10-06 20:59:38 -04:00
|
|
|
|
2022-05-13 10:14:05 -03:00
|
|
|
const select = (state, props) => {
|
|
|
|
const { uri } = props;
|
2020-01-25 14:37:02 -06:00
|
|
|
|
|
|
|
return {
|
|
|
|
uri,
|
2021-11-16 12:23:18 +08:00
|
|
|
title: selectTitleForUri(state, uri),
|
2020-01-25 14:37:02 -06:00
|
|
|
currentScroll: selectScrollStartingPosition(state),
|
|
|
|
isAuthenticated: selectUserVerifiedEmail(state),
|
2020-07-10 17:04:36 -04:00
|
|
|
hasNavigated: selectHasNavigated(state),
|
2020-10-06 20:59:38 -04:00
|
|
|
hasUnclaimedRefereeReward: selectHasUnclaimedRefereeReward(state),
|
2020-11-10 11:07:00 -05:00
|
|
|
homepageData: selectHomepageData(state),
|
2022-02-15 14:36:33 -03:00
|
|
|
wildWestDisabled: selectWildWestDisabled(state),
|
2022-03-22 15:03:39 -03:00
|
|
|
unseenCount: selectUnseenNotificationCount(state),
|
2022-03-31 22:19:19 +08:00
|
|
|
hideTitleNotificationCount: selectClientSetting(state, SETTINGS.HIDE_TITLE_NOTIFICATION_COUNT),
|
2022-05-04 10:59:10 -03:00
|
|
|
hasDefaultChannel: Boolean(selectClientSetting(state, SETTINGS.ACTIVE_CHANNEL_CLAIM)),
|
2020-01-25 14:37:02 -06:00
|
|
|
};
|
|
|
|
};
|
2019-07-17 16:49:06 -04:00
|
|
|
|
2022-05-04 10:59:10 -03:00
|
|
|
const perform = {
|
|
|
|
setHasNavigated: doSetHasNavigated,
|
|
|
|
setReferrer: doUserSetReferrer,
|
2022-05-10 09:01:19 -03:00
|
|
|
doSetActiveChannel,
|
2022-05-04 10:59:10 -03:00
|
|
|
};
|
2020-07-10 17:04:36 -04:00
|
|
|
|
|
|
|
export default connect(select, perform)(Router);
|