Added Submit and Cancel button on Payment Request.
This commit is contained in:
parent
494b1b2b77
commit
10c2e9dfee
@ -5,11 +5,11 @@ import { useForm } from 'react-hook-form';
|
|||||||
import { useExpenseType } from '../../hooks/masterHook/useMaster';
|
import { useExpenseType } from '../../hooks/masterHook/useMaster';
|
||||||
import DatePicker from '../common/DatePicker';
|
import DatePicker from '../common/DatePicker';
|
||||||
|
|
||||||
function ManagePaymentRequest({ expenseToEdit = null}) {
|
function ManagePaymentRequest({ closeModal, expenseToEdit = null }) {
|
||||||
|
|
||||||
const { projectNames, loading: projectLoading, error, isError: isProjectError,
|
const { projectNames, loading: projectLoading, error, isError: isProjectError,
|
||||||
} = useProjectName();
|
} = useProjectName();
|
||||||
const { register, control, watch, formState: { errors }, } = useForm();
|
const { register, control, watch,reset, formState: { errors }, } = useForm();
|
||||||
|
|
||||||
const {
|
const {
|
||||||
ExpenseTypes,
|
ExpenseTypes,
|
||||||
@ -78,6 +78,11 @@ function ManagePaymentRequest({ expenseToEdit = null}) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const handleClose = () => {
|
||||||
|
reset();
|
||||||
|
closeModal();
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="container p-3">
|
<div className="container p-3">
|
||||||
<h5 className="m-0">
|
<h5 className="m-0">
|
||||||
@ -316,6 +321,23 @@ function ManagePaymentRequest({ expenseToEdit = null}) {
|
|||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div className="d-flex justify-content-end gap-3">
|
||||||
|
<button
|
||||||
|
type="reset"
|
||||||
|
onClick={handleClose}
|
||||||
|
className="btn btn-label-secondary btn-sm mt-3"
|
||||||
|
>
|
||||||
|
Cancel
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<button
|
||||||
|
type="submit"
|
||||||
|
className="btn btn-primary btn-sm mt-3"
|
||||||
|
>
|
||||||
|
Submit
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user