lbry-desktop/ui/component/channelSelector/index.js

25 lines
871 B
JavaScript
Raw Normal View History

2020-03-18 18:11:37 +01:00
import { connect } from 'react-redux';
import { selectMyChannelClaims, selectClaimsByUri, selectOdyseeMembershipForUri } from 'redux/selectors/claims';
import { selectActiveChannelClaim, selectIncognito } from 'redux/selectors/app';
import { doSetActiveChannel, doSetIncognito } from 'redux/actions/app';
import { doFetchUserMemberships } from 'redux/actions/user';
import ChannelSelector from './view';
2020-03-18 18:11: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
export default connect(select, {
doSetActiveChannel,
doSetIncognito,
doFetchUserMemberships,
})(ChannelSelector);