close modal after sending support

This commit is contained in:
Sean Yesmunt 2020-04-29 18:02:53 -04:00
parent ad6d36f2e0
commit 0738d186a5
2 changed files with 5 additions and 2 deletions

View file

@ -8,7 +8,7 @@ import {
SETTINGS,
} from 'lbry-redux';
import WalletSendTip from './view';
import { doOpenModal } from 'redux/actions/app';
import { doOpenModal, doHideModal } from 'redux/actions/app';
import { withRouter } from 'react-router';
import { makeSelectClientSetting } from 'redux/selectors/settings';
@ -23,6 +23,7 @@ const select = (state, props) => ({
const perform = dispatch => ({
openModal: (modal, props) => dispatch(doOpenModal(modal, props)),
closeModal: () => dispatch(doHideModal()),
sendSupport: (amount, claimId, isSupport) => dispatch(doSendTip(amount, claimId, isSupport)),
});

View file

@ -17,7 +17,7 @@ type Props = {
isPending: boolean,
sendSupport: (number, string, boolean) => void,
onCancel: () => void,
sendTipCallback?: () => void,
closeModal: () => void,
balance: number,
isSupport: boolean,
openModal: (id: string, { tipAmount: number, claimId: string, isSupport: boolean }) => void,
@ -38,6 +38,7 @@ function WalletSendTip(props: Props) {
instantTipMax,
openModal,
sendSupport,
closeModal,
} = props;
const [tipAmount, setTipAmount] = React.useState(0);
const [tipError, setTipError] = React.useState();
@ -50,6 +51,7 @@ function WalletSendTip(props: Props) {
openModal(MODALS.CONFIRM_SEND_TIP, modalProps);
} else {
sendSupport(tipAmount, claimId, isSupport);
closeModal();
}
}