2017-12-21 22:08:54 +01:00
|
|
|
import { connect } from 'react-redux';
|
2020-04-23 18:44:18 +02:00
|
|
|
import {
|
|
|
|
makeSelectTitleForUri,
|
|
|
|
makeSelectClaimForUri,
|
2020-06-10 00:09:24 +02:00
|
|
|
makeSelectClaimIsMine,
|
2020-06-15 16:04:44 +02:00
|
|
|
selectFetchingMyChannels,
|
2021-10-08 05:47:39 +02:00
|
|
|
} from 'redux/selectors/claims';
|
|
|
|
import { selectBalance, selectIsSendingSupport } from 'redux/selectors/wallet';
|
|
|
|
import { doSendTip } from 'redux/actions/wallet';
|
|
|
|
import * as SETTINGS from 'constants/settings';
|
2018-04-04 01:58:58 +02:00
|
|
|
import WalletSendTip from './view';
|
2020-04-30 00:02:53 +02:00
|
|
|
import { doOpenModal, doHideModal } from 'redux/actions/app';
|
2020-04-23 10:18:17 +02:00
|
|
|
import { withRouter } from 'react-router';
|
2020-04-25 01:53:57 +02:00
|
|
|
import { makeSelectClientSetting } from 'redux/selectors/settings';
|
2021-02-09 17:05:56 +01:00
|
|
|
import { selectActiveChannelClaim, selectIncognito } from 'redux/selectors/app';
|
2021-07-03 19:19:23 +02:00
|
|
|
import { doToast } from 'redux/actions/notifications';
|
|
|
|
import { selectUserVerifiedEmail } from 'redux/selectors/user';
|
2017-09-17 22:33:52 +02:00
|
|
|
|
|
|
|
const select = (state, props) => ({
|
|
|
|
isPending: selectIsSendingSupport(state),
|
|
|
|
title: makeSelectTitleForUri(props.uri)(state),
|
2020-02-12 19:59:48 +01:00
|
|
|
claim: makeSelectClaimForUri(props.uri, false)(state),
|
2018-05-14 18:19:07 +02:00
|
|
|
balance: selectBalance(state),
|
2020-04-25 01:53:57 +02:00
|
|
|
instantTipEnabled: makeSelectClientSetting(SETTINGS.INSTANT_PURCHASE_ENABLED)(state),
|
|
|
|
instantTipMax: makeSelectClientSetting(SETTINGS.INSTANT_PURCHASE_MAX)(state),
|
2020-06-10 00:09:24 +02:00
|
|
|
claimIsMine: makeSelectClaimIsMine(props.uri)(state),
|
2020-06-15 16:04:44 +02:00
|
|
|
fetchingChannels: selectFetchingMyChannels(state),
|
2021-02-09 17:05:56 +01:00
|
|
|
activeChannelClaim: selectActiveChannelClaim(state),
|
|
|
|
incognito: selectIncognito(state),
|
2021-07-03 19:19:23 +02:00
|
|
|
isAuthenticated: Boolean(selectUserVerifiedEmail(state)),
|
2017-09-17 22:33:52 +02:00
|
|
|
});
|
|
|
|
|
2021-10-08 05:47:39 +02:00
|
|
|
const perform = (dispatch) => ({
|
2020-04-23 10:18:17 +02:00
|
|
|
openModal: (modal, props) => dispatch(doOpenModal(modal, props)),
|
2020-04-30 00:02:53 +02:00
|
|
|
closeModal: () => dispatch(doHideModal()),
|
2020-06-15 16:04:44 +02:00
|
|
|
sendSupport: (params, isSupport) => dispatch(doSendTip(params, isSupport)),
|
2021-07-03 19:19:23 +02:00
|
|
|
doToast: (options) => dispatch(doToast(options)),
|
2017-09-17 22:33:52 +02:00
|
|
|
});
|
|
|
|
|
2020-04-23 10:18:17 +02:00
|
|
|
export default withRouter(connect(select, perform)(WalletSendTip));
|