feat:(*): add currency code.

This commit is contained in:
elforjani3
2021-03-08 14:17:08 +02:00
parent 644b673411
commit 32b378e74e
17 changed files with 39 additions and 24 deletions

View File

@@ -11,6 +11,7 @@ import {
} from '@blueprintjs/core';
import { FormattedMessage as T } from 'react-intl';
import { useFormikContext } from 'formik';
import { useHistory } from 'react-router-dom';
import classNames from 'classnames';
import { CLASSES } from 'common/classes';
import { If, Icon } from 'components';
@@ -20,6 +21,9 @@ import { useReceiptFormContext } from './ReceiptFormProvider';
* Receipt floating actions bar.
*/
export default function ReceiptFormFloatingActions() {
// History context.
const history = useHistory();
// Formik context.
const { resetForm, submitForm, isSubmitting } = useFormikContext();
@@ -63,7 +67,7 @@ export default function ReceiptFormFloatingActions() {
// Handle cancel button click.
const handleCancelBtnClick = (event) => {
history.goBack();
};
const handleClearBtnClick = (event) => {

View File

@@ -128,7 +128,7 @@ export function useReceiptsTableColumns() {
{
id: 'amount',
Header: formatMessage({ id: 'amount' }),
accessor: (r) => <Money amount={r.amount} currency={'USD'} />,
accessor: (r) => <Money amount={r.amount} currency={r.currency_code} />,
width: 140,
className: 'amount',
},