mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-06-14 09:59:27 -04:00
Initial commit
This commit is contained in:
commit
bc188870af
162 changed files with 13820 additions and 0 deletions
34
src/renderer/components/modal/wallet/WithdrawDialog.tsx
Normal file
34
src/renderer/components/modal/wallet/WithdrawDialog.tsx
Normal file
|
@ -0,0 +1,34 @@
|
|||
import { Dialog } from '@material-ui/core';
|
||||
import { useAppDispatch, useIsRpcEndpointBusy } from 'store/hooks';
|
||||
import { RpcMethod } from 'models/rpcModel';
|
||||
import { rpcResetWithdrawTxId } from 'store/features/rpcSlice';
|
||||
import WithdrawStatePage from './WithdrawStatePage';
|
||||
import DialogHeader from '../DialogHeader';
|
||||
|
||||
export default function WithdrawDialog({
|
||||
open,
|
||||
onClose,
|
||||
}: {
|
||||
open: boolean;
|
||||
onClose: () => void;
|
||||
}) {
|
||||
const isRpcEndpointBusy = useIsRpcEndpointBusy(RpcMethod.WITHDRAW_BTC);
|
||||
const dispatch = useAppDispatch();
|
||||
|
||||
function onCancel() {
|
||||
if (!isRpcEndpointBusy) {
|
||||
onClose();
|
||||
dispatch(rpcResetWithdrawTxId());
|
||||
}
|
||||
}
|
||||
|
||||
// This prevents an issue where the Dialog is shown for a split second without a present withdraw state
|
||||
if (!open && !isRpcEndpointBusy) return null;
|
||||
|
||||
return (
|
||||
<Dialog open onClose={onCancel} maxWidth="sm" fullWidth>
|
||||
<DialogHeader title="Withdraw Bitcoin" />
|
||||
<WithdrawStatePage onCancel={onCancel} />
|
||||
</Dialog>
|
||||
);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue