2017-12-21 22:08:54 +01:00
|
|
|
import React from 'react';
|
|
|
|
import { connect } from 'react-redux';
|
|
|
|
import { selectFetchingRewards, selectUnclaimedRewards } from 'redux/selectors/rewards';
|
|
|
|
import { selectUser } from 'redux/selectors/user';
|
|
|
|
import { doAuthNavigate, doNavigate } from 'redux/actions/navigation';
|
|
|
|
import { doRewardList } from 'redux/actions/rewards';
|
|
|
|
import RewardsPage from './view';
|
2017-05-26 10:53:32 +02:00
|
|
|
|
2017-12-13 22:36:30 +01:00
|
|
|
const select = (state, props) => ({
|
|
|
|
fetching: selectFetchingRewards(state),
|
|
|
|
rewards: selectUnclaimedRewards(state),
|
|
|
|
user: selectUser(state),
|
|
|
|
});
|
2017-05-26 10:53:32 +02:00
|
|
|
|
2017-06-23 07:29:40 +02:00
|
|
|
const perform = dispatch => ({
|
|
|
|
fetchRewards: () => dispatch(doRewardList()),
|
2017-07-20 03:07:17 +02:00
|
|
|
navigate: path => dispatch(doNavigate(path)),
|
2017-07-19 17:09:40 +02:00
|
|
|
doAuth: () => {
|
2017-12-21 22:08:54 +01:00
|
|
|
dispatch(doAuthNavigate('/rewards'));
|
2017-07-19 17:09:40 +02:00
|
|
|
},
|
2017-06-23 07:29:40 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
export default connect(select, perform)(RewardsPage);
|