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 DatePicker from '../common/DatePicker';
|
||||
|
||||
function ManagePaymentRequest({ expenseToEdit = null}) {
|
||||
function ManagePaymentRequest({ closeModal, expenseToEdit = null }) {
|
||||
|
||||
const { projectNames, loading: projectLoading, error, isError: isProjectError,
|
||||
} = useProjectName();
|
||||
const { register, control, watch, formState: { errors }, } = useForm();
|
||||
const { register, control, watch,reset, formState: { errors }, } = useForm();
|
||||
|
||||
const {
|
||||
ExpenseTypes,
|
||||
@ -78,6 +78,11 @@ function ManagePaymentRequest({ expenseToEdit = null}) {
|
||||
}
|
||||
};
|
||||
|
||||
const handleClose = () => {
|
||||
reset();
|
||||
closeModal();
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="container p-3">
|
||||
<h5 className="m-0">
|
||||
@ -316,6 +321,23 @@ function ManagePaymentRequest({ expenseToEdit = null}) {
|
||||
))}
|
||||
</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>
|
||||
</div>
|
||||
)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user