close modal after sending support
This commit is contained in:
parent
ad6d36f2e0
commit
0738d186a5
2 changed files with 5 additions and 2 deletions
|
@ -8,7 +8,7 @@ import {
|
||||||
SETTINGS,
|
SETTINGS,
|
||||||
} from 'lbry-redux';
|
} from 'lbry-redux';
|
||||||
import WalletSendTip from './view';
|
import WalletSendTip from './view';
|
||||||
import { doOpenModal } from 'redux/actions/app';
|
import { doOpenModal, doHideModal } from 'redux/actions/app';
|
||||||
import { withRouter } from 'react-router';
|
import { withRouter } from 'react-router';
|
||||||
import { makeSelectClientSetting } from 'redux/selectors/settings';
|
import { makeSelectClientSetting } from 'redux/selectors/settings';
|
||||||
|
|
||||||
|
@ -23,6 +23,7 @@ const select = (state, props) => ({
|
||||||
|
|
||||||
const perform = dispatch => ({
|
const perform = dispatch => ({
|
||||||
openModal: (modal, props) => dispatch(doOpenModal(modal, props)),
|
openModal: (modal, props) => dispatch(doOpenModal(modal, props)),
|
||||||
|
closeModal: () => dispatch(doHideModal()),
|
||||||
sendSupport: (amount, claimId, isSupport) => dispatch(doSendTip(amount, claimId, isSupport)),
|
sendSupport: (amount, claimId, isSupport) => dispatch(doSendTip(amount, claimId, isSupport)),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@ type Props = {
|
||||||
isPending: boolean,
|
isPending: boolean,
|
||||||
sendSupport: (number, string, boolean) => void,
|
sendSupport: (number, string, boolean) => void,
|
||||||
onCancel: () => void,
|
onCancel: () => void,
|
||||||
sendTipCallback?: () => void,
|
closeModal: () => void,
|
||||||
balance: number,
|
balance: number,
|
||||||
isSupport: boolean,
|
isSupport: boolean,
|
||||||
openModal: (id: string, { tipAmount: number, claimId: string, isSupport: boolean }) => void,
|
openModal: (id: string, { tipAmount: number, claimId: string, isSupport: boolean }) => void,
|
||||||
|
@ -38,6 +38,7 @@ function WalletSendTip(props: Props) {
|
||||||
instantTipMax,
|
instantTipMax,
|
||||||
openModal,
|
openModal,
|
||||||
sendSupport,
|
sendSupport,
|
||||||
|
closeModal,
|
||||||
} = props;
|
} = props;
|
||||||
const [tipAmount, setTipAmount] = React.useState(0);
|
const [tipAmount, setTipAmount] = React.useState(0);
|
||||||
const [tipError, setTipError] = React.useState();
|
const [tipError, setTipError] = React.useState();
|
||||||
|
@ -50,6 +51,7 @@ function WalletSendTip(props: Props) {
|
||||||
openModal(MODALS.CONFIRM_SEND_TIP, modalProps);
|
openModal(MODALS.CONFIRM_SEND_TIP, modalProps);
|
||||||
} else {
|
} else {
|
||||||
sendSupport(tipAmount, claimId, isSupport);
|
sendSupport(tipAmount, claimId, isSupport);
|
||||||
|
closeModal();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue