refactoring(invoice drawer): invoice drawer.

This commit is contained in:
elforjani3
2021-03-06 20:29:32 +02:00
parent fe5fc80ecb
commit 252f3b4617
6 changed files with 109 additions and 21 deletions

View File

@@ -90,6 +90,18 @@ export const handleDeleteErrors = (errors) => {
intent: Intent.DANGER,
});
}
if (
errors.find(
(error) => error.type === 'INVOICE_AMOUNT_SMALLER_THAN_PAYMENT_AMOUNT',
)
) {
AppToaster.show({
message: formatMessage({
id: 'the_payment_amount_that_received',
}),
intent: Intent.DANGER,
});
}
};
export function ActionsMenu({
@@ -120,7 +132,7 @@ export function ActionsMenu({
<MenuItem
icon={<Icon icon={'receipt-24'} iconSize={16} />}
text={formatMessage({ id: 'invoice_paper' })}
onClick={() => onDrawer()}
onClick={safeCallback(onDrawer, original)}
/>
<MenuItem
text={formatMessage({ id: 'delete_invoice' })}