2020-03-18 18:11:37 +01:00
|
|
|
import { connect } from 'react-redux';
|
2022-03-09 19:05:37 +01:00
|
|
|
import { selectMyChannelClaims, selectClaimsByUri, selectOdyseeMembershipForUri } from 'redux/selectors/claims';
|
2021-02-09 17:05:56 +01:00
|
|
|
import { selectActiveChannelClaim, selectIncognito } from 'redux/selectors/app';
|
|
|
|
import { doSetActiveChannel, doSetIncognito } from 'redux/actions/app';
|
2022-03-09 19:05:37 +01:00
|
|
|
import { doFetchUserMemberships } from 'redux/actions/user';
|
2021-07-06 03:29:46 +02:00
|
|
|
import ChannelSelector from './view';
|
2020-03-18 18:11:37 +01:00
|
|
|
|
2022-03-09 19:05:37 +01:00
|
|
|
const select = (state, props) => {
|
|
|
|
const activeChannelClaim = selectActiveChannelClaim(state);
|
|
|
|
|
|
|
|
return {
|
|
|
|
channels: selectMyChannelClaims(state),
|
|
|
|
activeChannelClaim,
|
|
|
|
incognito: selectIncognito(state),
|
|
|
|
odyseeMembershipByUri: (uri) => selectOdyseeMembershipForUri(state, uri),
|
|
|
|
claimsByUri: selectClaimsByUri(state),
|
|
|
|
};
|
|
|
|
};
|
2020-03-18 18:11:37 +01:00
|
|
|
|
2021-02-09 17:05:56 +01:00
|
|
|
export default connect(select, {
|
|
|
|
doSetActiveChannel,
|
|
|
|
doSetIncognito,
|
2022-03-09 19:05:37 +01:00
|
|
|
doFetchUserMemberships,
|
2021-07-06 03:29:46 +02:00
|
|
|
})(ChannelSelector);
|