refactoring: payment receive form.

This commit is contained in:
a.bouhuolia
2021-02-17 19:45:18 +02:00
parent 95cccfd13b
commit e36817cb88
46 changed files with 775 additions and 325 deletions

View File

@@ -1,22 +0,0 @@
function ChangingFullAmountAlert() {
return (
<Alert
cancelButtonText={<T id={'cancel'} />}
confirmButtonText={<T id={'ok'} />}
intent={Intent.WARNING}
isOpen={amountChangeAlert}
onCancel={handleCancelAmountChangeAlert}
onConfirm={handleConfirmAmountChangeAlert}
>
<p>
<T
id={'changing_full_amount_will_change_all_credits_and_payment'}
/>
</p>
</Alert>
)
}

View File

@@ -1,21 +0,0 @@
function ClearTransactionAlert() {
return (
<Alert
cancelButtonText={<T id={'cancel'} />}
confirmButtonText={<T id={'ok'} />}
intent={Intent.WARNING}
isOpen={clearFormAlert}
onCancel={handleCancelClearFormAlert}
onConfirm={handleConfirmCancelClearFormAlert}
>
<p>
<T id={'are_you_sure_you_want_to_clear_this_transaction'} />
</p>
</Alert>
)
}

View File

@@ -1,20 +1,54 @@
import React from 'react';
import { Intent, Alert } from '@blueprintjs/core';
import { FormattedMessage as T } from 'react-intl';
import withAlertActions from 'containers/Alert/withAlertActions';
import withAlertStoreConnect from 'containers/Alert/withAlertStoreConnect';
import { saveInvoke, compose } from 'utils';
function ClearingAllLinesAlert() {
/**
* Clearning all lines alert.
*/
function ClearningAllLinesAlert({
name,
onConfirm,
return (
<Alert
cancelButtonText={<T id={'cancel'} />}
confirmButtonText={<T id={'ok'} />}
intent={Intent.WARNING}
isOpen={clearLinesAlert}
onCancel={handleCancelClearLines}
onConfirm={handleConfirmClearLines}
>
<p>
<T id={'clearing_the_table_lines_will_delete_all_credits'} />
</p>
</Alert>
)
}
// #withAlertStoreConnect
isOpen,
payload: {},
// #withAlertActions
closeAlert,
}) {
// Handle the alert cancel.
const handleCancel = () => {
closeAlert(name);
};
// Handle confirm delete manual journal.
const handleConfirm = (event) => {
closeAlert(name);
saveInvoke(onConfirm, event)
};
return (
<Alert
cancelButtonText={<T id={'cancel'} />}
confirmButtonText={<T id={'action'} />}
intent={Intent.DANGER}
isOpen={isOpen}
onCancel={handleCancel}
onConfirm={handleConfirm}
>
<p>
<T id={'clearing_the_table_lines_will_delete_all_credits'} />
</p>
</Alert>
);
}
export default compose(
withAlertStoreConnect(),
withAlertActions,
)(ClearningAllLinesAlert);