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

38 lines
1.4 KiB
JavaScript
Raw Normal View History

import { connect } from 'react-redux';
import {
doSendTip,
makeSelectTitleForUri,
makeSelectClaimForUri,
selectIsSendingSupport,
selectBalance,
SETTINGS,
makeSelectClaimIsMine,
2020-06-15 10:04:44 -04:00
selectFetchingMyChannels,
} 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';
import { withRouter } from 'react-router';
import { makeSelectClientSetting } from 'redux/selectors/settings';
import { selectActiveChannelClaim, selectIncognito } from 'redux/selectors/app';
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),
balance: selectBalance(state),
instantTipEnabled: makeSelectClientSetting(SETTINGS.INSTANT_PURCHASE_ENABLED)(state),
instantTipMax: makeSelectClientSetting(SETTINGS.INSTANT_PURCHASE_MAX)(state),
claimIsMine: makeSelectClaimIsMine(props.uri)(state),
2020-06-15 10:04:44 -04:00
fetchingChannels: selectFetchingMyChannels(state),
activeChannelClaim: selectActiveChannelClaim(state),
incognito: selectIncognito(state),
2017-09-17 16:33:52 -04:00
});
const perform = dispatch => ({
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
});
export default withRouter(connect(select, perform)(WalletSendTip));