2018-03-26 23:32:43 +02:00
|
|
|
import { connect } from 'react-redux';
|
|
|
|
import SelectChannel from './view';
|
2021-10-17 10:36:14 +02:00
|
|
|
import { selectMyChannelClaims, selectFetchingMyChannels } from 'redux/selectors/claims';
|
2021-12-02 13:59:34 +01:00
|
|
|
import { selectActiveChannelId } from 'redux/selectors/app';
|
2021-02-09 17:05:56 +01:00
|
|
|
import { doSetActiveChannel } from 'redux/actions/app';
|
2018-03-26 23:32:43 +02:00
|
|
|
|
2021-10-17 10:36:14 +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),
|
2021-12-02 13:59:34 +01:00
|
|
|
activeChannelId: selectActiveChannelId(state),
|
2018-03-26 23:32:43 +02:00
|
|
|
});
|
|
|
|
|
2021-10-17 10:36:14 +02:00
|
|
|
const perform = (dispatch) => ({
|
|
|
|
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);
|