2017-06-08 02:56:52 +02:00
|
|
|
import React from "react";
|
|
|
|
import { connect } from "react-redux";
|
|
|
|
import { doNavigate } from "actions/app";
|
2017-06-08 23:15:34 +02:00
|
|
|
import { selectFetchingRewards, selectRewards } from "selectors/rewards";
|
2017-06-03 01:09:52 +02:00
|
|
|
import {
|
2017-06-08 02:56:52 +02:00
|
|
|
selectUserIsRewardEligible,
|
|
|
|
selectUserHasEmail,
|
|
|
|
selectUserIsVerificationCandidate,
|
|
|
|
} from "selectors/user";
|
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-06-08 02:56:52 +02:00
|
|
|
const select = state => ({
|
2017-05-26 10:53:32 +02:00
|
|
|
fetching: selectFetchingRewards(state),
|
|
|
|
rewards: selectRewards(state),
|
2017-06-08 02:56:52 +02:00
|
|
|
hasEmail: selectUserHasEmail(state),
|
|
|
|
isEligible: selectUserIsRewardEligible(state),
|
|
|
|
isVerificationCandidate: selectUserIsVerificationCandidate(state),
|
|
|
|
});
|
2017-05-26 10:53:32 +02:00
|
|
|
|
2017-06-23 07:29:40 +02:00
|
|
|
const perform = dispatch => ({
|
|
|
|
fetchRewards: () => dispatch(doRewardList()),
|
|
|
|
});
|
|
|
|
|
|
|
|
export default connect(select, perform)(RewardsPage);
|