2017-12-21 18:08:54 -03:00
|
|
|
import { connect } from 'react-redux';
|
2020-04-23 09:44:18 -07:00
|
|
|
import {
|
|
|
|
doSendTip,
|
|
|
|
makeSelectTitleForUri,
|
|
|
|
makeSelectClaimForUri,
|
|
|
|
selectIsSendingSupport,
|
|
|
|
selectBalance,
|
2020-04-24 16:53:57 -07:00
|
|
|
SETTINGS,
|
2020-06-09 18:09:24 -04:00
|
|
|
selectMyChannelClaims,
|
|
|
|
makeSelectClaimIsMine,
|
2020-06-15 10:04:44 -04:00
|
|
|
selectFetchingMyChannels,
|
2020-04-23 09:44:18 -07:00
|
|
|
} from 'lbry-redux';
|
2018-04-03 19:58:58 -04:00
|
|
|
import WalletSendTip from './view';
|
2020-04-29 18:02:53 -04:00
|
|
|
import { doOpenModal, doHideModal } from 'redux/actions/app';
|
2020-04-23 01:18:17 -07:00
|
|
|
import { withRouter } from 'react-router';
|
2020-04-24 16:53:57 -07:00
|
|
|
import { makeSelectClientSetting } from 'redux/selectors/settings';
|
2017-09-17 16:33:52 -04:00
|
|
|
|
|
|
|
const select = (state, props) => ({
|
|
|
|
isPending: selectIsSendingSupport(state),
|
|
|
|
title: makeSelectTitleForUri(props.uri)(state),
|
2020-02-12 13:59:48 -05:00
|
|
|
claim: makeSelectClaimForUri(props.uri, false)(state),
|
2018-05-14 12:19:07 -04:00
|
|
|
balance: selectBalance(state),
|
2020-04-24 16:53:57 -07:00
|
|
|
instantTipEnabled: makeSelectClientSetting(SETTINGS.INSTANT_PURCHASE_ENABLED)(state),
|
|
|
|
instantTipMax: makeSelectClientSetting(SETTINGS.INSTANT_PURCHASE_MAX)(state),
|
2020-06-09 18:09:24 -04:00
|
|
|
channels: selectMyChannelClaims(state),
|
|
|
|
claimIsMine: makeSelectClaimIsMine(props.uri)(state),
|
2020-06-15 10:04:44 -04:00
|
|
|
fetchingChannels: selectFetchingMyChannels(state),
|
2017-09-17 16:33:52 -04:00
|
|
|
});
|
|
|
|
|
|
|
|
const perform = dispatch => ({
|
2020-04-23 01:18:17 -07:00
|
|
|
openModal: (modal, props) => dispatch(doOpenModal(modal, props)),
|
2020-04-29 18:02:53 -04:00
|
|
|
closeModal: () => dispatch(doHideModal()),
|
2020-06-15 10:04:44 -04:00
|
|
|
sendSupport: (params, isSupport) => dispatch(doSendTip(params, isSupport)),
|
2017-09-17 16:33:52 -04:00
|
|
|
});
|
|
|
|
|
2020-04-23 01:18:17 -07:00
|
|
|
export default withRouter(connect(select, perform)(WalletSendTip));
|