mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-20 06:40:31 +00:00
feat: add project.
This commit is contained in:
19
src/containers/Projects/components/FInputGroupComponent.tsx
Normal file
19
src/containers/Projects/components/FInputGroupComponent.tsx
Normal file
@@ -0,0 +1,19 @@
|
||||
import React from 'react';
|
||||
import { FInputGroup } from '@/components';
|
||||
import { useFormikContext } from 'formik';
|
||||
|
||||
export function FInputGroupComponent({ toField, ...props }) {
|
||||
const { values, setFieldValue } = useFormikContext();
|
||||
const { expenseQuantity, expenseUnitPrice } = values;
|
||||
const total = expenseQuantity * expenseUnitPrice;
|
||||
|
||||
const handleBlur = () => {
|
||||
setFieldValue(toField, total);
|
||||
};
|
||||
|
||||
const inputGroupProps = {
|
||||
onBlur: handleBlur,
|
||||
...props,
|
||||
};
|
||||
return <FInputGroup {...inputGroupProps} />;
|
||||
}
|
||||
Reference in New Issue
Block a user