2022-03-09 19:05:37 +01:00
|
|
|
import { connect } from 'react-redux';
|
|
|
|
import { doOpenModal } from 'redux/actions/app';
|
|
|
|
import OdyseeMembership from './view';
|
|
|
|
import { selectActiveChannelClaim, selectIncognito } from 'redux/selectors/app';
|
|
|
|
import { selectMyChannelClaims, selectClaimsByUri } from 'redux/selectors/claims';
|
|
|
|
import { doFetchUserMemberships, doCheckUserOdyseeMemberships } from 'redux/actions/user';
|
2022-03-23 18:13:04 +01:00
|
|
|
import { selectClientSetting } from 'redux/selectors/settings';
|
2022-03-17 07:12:16 +01:00
|
|
|
import { selectUser, selectUserLocale } from 'redux/selectors/user';
|
2022-03-23 18:13:04 +01:00
|
|
|
import * as SETTINGS from 'constants/settings';
|
2022-03-09 19:05:37 +01:00
|
|
|
|
|
|
|
const select = (state) => {
|
|
|
|
const activeChannelClaim = selectActiveChannelClaim(state);
|
|
|
|
|
|
|
|
return {
|
|
|
|
activeChannelClaim,
|
|
|
|
channels: selectMyChannelClaims(state),
|
|
|
|
claimsByUri: selectClaimsByUri(state),
|
|
|
|
incognito: selectIncognito(state),
|
|
|
|
user: selectUser(state),
|
2022-03-17 07:12:16 +01:00
|
|
|
locale: selectUserLocale(state),
|
2022-03-23 18:13:04 +01:00
|
|
|
preferredCurrency: selectClientSetting(state, SETTINGS.PREFERRED_CURRENCY),
|
2022-03-09 19:05:37 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
const perform = (dispatch) => ({
|
|
|
|
openModal: (modal, props) => dispatch(doOpenModal(modal, props)),
|
|
|
|
fetchUserMemberships: (claimIds) => dispatch(doFetchUserMemberships(claimIds)),
|
|
|
|
updateUserOdyseeMembershipStatus: (user) => dispatch(doCheckUserOdyseeMemberships(user)),
|
|
|
|
});
|
|
|
|
|
|
|
|
export default connect(select, perform)(OdyseeMembership);
|