2018-03-26 14:32:43 -07:00
|
|
|
import { connect } from 'react-redux';
|
|
|
|
import SelectChannel from './view';
|
2021-10-17 16:36:14 +08:00
|
|
|
import { selectMyChannelClaims, selectFetchingMyChannels } from 'redux/selectors/claims';
|
2021-12-02 20:59:34 +08:00
|
|
|
import { selectActiveChannelId } from 'redux/selectors/app';
|
2021-02-09 11:05:56 -05:00
|
|
|
import { doSetActiveChannel } from 'redux/actions/app';
|
2018-03-26 14:32:43 -07:00
|
|
|
|
2021-10-17 16:36:14 +08:00
|
|
|
const select = (state) => ({
|
2021-02-09 11:05:56 -05:00
|
|
|
myChannelClaims: selectMyChannelClaims(state),
|
2018-03-26 14:32:43 -07:00
|
|
|
fetchingChannels: selectFetchingMyChannels(state),
|
2021-12-02 20:59:34 +08:00
|
|
|
activeChannelId: selectActiveChannelId(state),
|
2018-03-26 14:32:43 -07:00
|
|
|
});
|
|
|
|
|
2021-10-17 16:36:14 +08:00
|
|
|
const perform = (dispatch) => ({
|
|
|
|
setActiveChannel: (claimId) => dispatch(doSetActiveChannel(claimId)),
|
2018-03-26 14:32:43 -07:00
|
|
|
});
|
|
|
|
|
2020-06-15 16:33:03 -04:00
|
|
|
export default connect(select, perform)(SelectChannel);
|