2018-03-26 23:32:43 +02:00
|
|
|
import { connect } from 'react-redux';
|
|
|
|
import SelectChannel from './view';
|
2021-10-08 05:47:39 +02:00
|
|
|
import { selectBalance } from 'redux/selectors/wallet';
|
|
|
|
import { selectMyChannelClaims, selectFetchingMyChannels } from 'redux/selectors/claims';
|
|
|
|
import { doFetchChannelListMine, doCreateChannel } from 'redux/actions/claims';
|
2020-06-15 22:33:03 +02:00
|
|
|
import { selectUserVerifiedEmail } from 'redux/selectors/user';
|
2021-02-09 17:05:56 +01:00
|
|
|
import { selectActiveChannelClaim } from 'redux/selectors/app';
|
|
|
|
import { doSetActiveChannel } from 'redux/actions/app';
|
2018-03-26 23:32:43 +02:00
|
|
|
|
2021-10-08 05:47:39 +02:00
|
|
|
const select = (state) => ({
|
2021-02-09 17:05:56 +01:00
|
|
|
myChannelClaims: selectMyChannelClaims(state),
|
2018-03-26 23:32:43 +02:00
|
|
|
fetchingChannels: selectFetchingMyChannels(state),
|
|
|
|
balance: selectBalance(state),
|
2019-10-28 19:53:59 +01:00
|
|
|
emailVerified: selectUserVerifiedEmail(state),
|
2021-02-09 17:05:56 +01:00
|
|
|
activeChannelClaim: selectActiveChannelClaim(state),
|
2018-03-26 23:32:43 +02:00
|
|
|
});
|
|
|
|
|
2021-10-08 05:47:39 +02:00
|
|
|
const perform = (dispatch) => ({
|
2018-03-26 23:32:43 +02:00
|
|
|
createChannel: (name, amount) => dispatch(doCreateChannel(name, amount)),
|
|
|
|
fetchChannelListMine: () => dispatch(doFetchChannelListMine()),
|
2021-10-08 05:47:39 +02:00
|
|
|
setActiveChannel: (claimId) => dispatch(doSetActiveChannel(claimId)),
|
2018-03-26 23:32:43 +02:00
|
|
|
});
|
|
|
|
|
2020-06-15 22:33:03 +02:00
|
|
|
export default connect(select, perform)(SelectChannel);
|