2017-06-08 02:56:52 +02:00
|
|
|
import React from "react";
|
|
|
|
import { connect } from "react-redux";
|
2017-07-16 18:29:46 +02:00
|
|
|
import {
|
|
|
|
selectFetchingRewards,
|
2017-08-19 05:08:01 +02:00
|
|
|
selectUnclaimedRewards,
|
2017-07-16 18:29:46 +02:00
|
|
|
} from "selectors/rewards";
|
2017-07-20 21:03:01 +02:00
|
|
|
import { selectUser } from "selectors/user";
|
2017-07-20 03:07:17 +02:00
|
|
|
import { doAuthNavigate, doNavigate } from "actions/app";
|
2017-06-23 07:29:40 +02:00
|
|
|
import { doRewardList } from "actions/rewards";
|
2017-06-08 02:56:52 +02:00
|
|
|
import RewardsPage from "./view";
|
2017-05-26 10:53:32 +02:00
|
|
|
|
2017-07-16 18:29:46 +02:00
|
|
|
const select = (state, props) => {
|
|
|
|
return {
|
|
|
|
fetching: selectFetchingRewards(state),
|
2017-08-19 05:08:01 +02:00
|
|
|
rewards: selectUnclaimedRewards(state),
|
2017-07-20 03:07:17 +02:00
|
|
|
user: selectUser(state),
|
2017-07-16 18:29:46 +02:00
|
|
|
};
|
|
|
|
};
|
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: () => {
|
|
|
|
dispatch(doAuthNavigate("/rewards"));
|
|
|
|
},
|
2017-06-23 07:29:40 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
export default connect(select, perform)(RewardsPage);
|