lbry-desktop/src/renderer/page/publish/index.js

45 lines
1.5 KiB
JavaScript
Raw Normal View History

2017-06-06 23:19:12 +02:00
import React from "react";
import { connect } from "react-redux";
2017-11-13 22:02:23 +01:00
import { doNavigate, doHistoryBack } from "redux/actions/navigation";
import { doClaimRewardType } from "redux/actions/rewards";
2017-07-10 16:49:12 +02:00
import {
selectMyClaims,
selectFetchingMyChannels,
selectMyChannelClaims,
selectClaimsByUri,
2017-11-13 22:02:23 +01:00
} from "redux/selectors/claims";
import { selectResolvingUris } from "redux/selectors/content";
import {
doFetchClaimListMine,
doFetchChannelListMine,
doResolveUri,
2017-06-17 19:59:18 +02:00
doCreateChannel,
doPublish,
2017-11-13 22:02:23 +01:00
} from "redux/actions/content";
import { selectBalance } from "redux/selectors/wallet";
2017-06-08 23:15:34 +02:00
import rewards from "rewards";
2017-06-06 23:19:12 +02:00
import PublishPage from "./view";
2017-05-02 10:21:00 +02:00
2017-06-06 06:21:55 +02:00
const select = state => ({
2017-08-26 05:21:26 +02:00
balance: selectBalance(state),
2017-06-06 23:19:12 +02:00
myClaims: selectMyClaims(state),
2017-07-10 16:49:12 +02:00
fetchingChannels: selectFetchingMyChannels(state),
channels: selectMyChannelClaims(state),
claimsByUri: selectClaimsByUri(state),
resolvingUris: selectResolvingUris(state),
2017-06-06 06:21:55 +02:00
});
2017-05-02 10:21:00 +02:00
2017-06-06 06:21:55 +02:00
const perform = dispatch => ({
2017-05-21 18:15:41 +02:00
back: () => dispatch(doHistoryBack()),
2017-06-06 23:19:12 +02:00
navigate: path => dispatch(doNavigate(path)),
fetchClaimListMine: () => dispatch(doFetchClaimListMine()),
2017-06-20 14:08:52 +02:00
claimFirstChannelReward: () =>
dispatch(doClaimRewardType(rewards.TYPE_FIRST_CHANNEL)),
2017-07-10 16:49:12 +02:00
fetchChannelListMine: () => dispatch(doFetchChannelListMine()),
resolveUri: uri => dispatch(doResolveUri(uri)),
2017-06-17 19:59:18 +02:00
createChannel: (name, amount) => dispatch(doCreateChannel(name, amount)),
publish: params => dispatch(doPublish(params)),
2017-06-06 06:21:55 +02:00
});
2017-05-02 10:21:00 +02:00
2017-06-06 06:21:55 +02:00
export default connect(select, perform)(PublishPage);