mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-13 11:20:31 +00:00
43 lines
1.3 KiB
JavaScript
43 lines
1.3 KiB
JavaScript
import React from 'react';
|
|
import { Intent, Button, Classes } from '@blueprintjs/core';
|
|
import { useFormikContext } from 'formik';
|
|
import { FormattedMessage as T } from 'components';
|
|
|
|
import { useQuickPaymentReceiveContext } from './QuickPaymentReceiveFormProvider';
|
|
import withDialogActions from 'containers/Dialog/withDialogActions';
|
|
import { compose } from 'utils';
|
|
|
|
function QuickPaymentReceiveFloatingActions({
|
|
// #withDialogActions
|
|
closeDialog,
|
|
}) {
|
|
// Formik context.
|
|
const { isSubmitting } = useFormikContext();
|
|
|
|
// quick payment receive dialog context.
|
|
const { dialogName } = useQuickPaymentReceiveContext();
|
|
|
|
// Handle close button click.
|
|
const handleCancelBtnClick = () => {
|
|
closeDialog(dialogName);
|
|
};
|
|
return (
|
|
<div className={Classes.DIALOG_FOOTER}>
|
|
<div className={Classes.DIALOG_FOOTER_ACTIONS}>
|
|
<Button onClick={handleCancelBtnClick} style={{ minWidth: '75px' }}>
|
|
<T id={'cancel'} />
|
|
</Button>
|
|
<Button
|
|
intent={Intent.PRIMARY}
|
|
loading={isSubmitting}
|
|
style={{ minWidth: '75px' }}
|
|
type="submit"
|
|
>
|
|
{<T id={'make_payment'} />}
|
|
</Button>
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|
|
export default compose(withDialogActions)(QuickPaymentReceiveFloatingActions);
|