2017-06-06 17:19:12 -04:00
|
|
|
import React from "react";
|
|
|
|
import { connect } from "react-redux";
|
|
|
|
import { doNavigate, doHistoryBack } from "actions/app";
|
2017-06-08 17:15:34 -04:00
|
|
|
import { doClaimRewardType } from "actions/rewards";
|
2017-07-10 21:49:12 +07:00
|
|
|
import {
|
|
|
|
selectMyClaims,
|
|
|
|
selectFetchingMyChannels,
|
|
|
|
selectMyChannelClaims,
|
|
|
|
} from "selectors/claims";
|
|
|
|
import { doFetchClaimListMine, doFetchChannelListMine } from "actions/content";
|
2017-06-08 17:15:34 -04:00
|
|
|
import rewards from "rewards";
|
2017-06-06 17:19:12 -04:00
|
|
|
import PublishPage from "./view";
|
2017-05-02 15:21:00 +07:00
|
|
|
|
2017-06-05 21:21:55 -07:00
|
|
|
const select = state => ({
|
2017-06-06 17:19:12 -04:00
|
|
|
myClaims: selectMyClaims(state),
|
2017-07-10 21:49:12 +07:00
|
|
|
fetchingChannels: selectFetchingMyChannels(state),
|
|
|
|
channels: selectMyChannelClaims(state),
|
2017-06-05 21:21:55 -07:00
|
|
|
});
|
2017-05-02 15:21:00 +07:00
|
|
|
|
2017-06-05 21:21:55 -07:00
|
|
|
const perform = dispatch => ({
|
2017-05-21 12:15:41 -04:00
|
|
|
back: () => dispatch(doHistoryBack()),
|
2017-06-06 17:19:12 -04:00
|
|
|
navigate: path => dispatch(doNavigate(path)),
|
2017-06-09 06:38:18 -04:00
|
|
|
fetchClaimListMine: () => dispatch(doFetchClaimListMine()),
|
2017-06-20 08:08:52 -04:00
|
|
|
claimFirstChannelReward: () =>
|
|
|
|
dispatch(doClaimRewardType(rewards.TYPE_FIRST_CHANNEL)),
|
2017-07-10 21:49:12 +07:00
|
|
|
fetchChannelListMine: () => dispatch(doFetchChannelListMine()),
|
2017-06-05 21:21:55 -07:00
|
|
|
});
|
2017-05-02 15:21:00 +07:00
|
|
|
|
2017-06-05 21:21:55 -07:00
|
|
|
export default connect(select, perform)(PublishPage);
|