mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-25 07:45:47 +00:00
refactor(FE): Refactor CustomerPaymentTab to use filterParams instead of
formik values
This commit is contained in:
@@ -119,7 +119,6 @@ const CustomerPaymentTab = ({ tabId }: CustomerPaymentTabProps) => {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
// Set the ref callback after formik is initialized
|
|
||||||
handleFilterModalOpenRef.current = () => {
|
handleFilterModalOpenRef.current = () => {
|
||||||
filterModal.openModal();
|
filterModal.openModal();
|
||||||
formik.validateForm();
|
formik.validateForm();
|
||||||
@@ -360,15 +359,12 @@ const CustomerPaymentTab = ({ tabId }: CustomerPaymentTabProps) => {
|
|||||||
(state) => state.clearTabActions
|
(state) => state.clearTabActions
|
||||||
);
|
);
|
||||||
|
|
||||||
const formikValuesRef = useRef(formik.values);
|
|
||||||
formikValuesRef.current = formik.values;
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setTabActions(
|
setTabActions(
|
||||||
tabId,
|
tabId,
|
||||||
<div className='flex flex-row gap-3'>
|
<div className='flex flex-row gap-3'>
|
||||||
<ButtonFilter
|
<ButtonFilter
|
||||||
values={formikValuesRef.current}
|
values={filterParams}
|
||||||
fieldGroups={[['start_date', 'end_date']]}
|
fieldGroups={[['start_date', 'end_date']]}
|
||||||
onClick={() => handleFilterModalOpenRef.current()}
|
onClick={() => handleFilterModalOpenRef.current()}
|
||||||
variant='outline'
|
variant='outline'
|
||||||
@@ -449,7 +445,7 @@ const CustomerPaymentTab = ({ tabId }: CustomerPaymentTabProps) => {
|
|||||||
handleExportPdf,
|
handleExportPdf,
|
||||||
isExcelExportLoading,
|
isExcelExportLoading,
|
||||||
isPdfExportLoading,
|
isPdfExportLoading,
|
||||||
formik.values,
|
filterParams,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const TabActionsElement = useMemo(() => <TabActions />, [TabActions]);
|
const TabActionsElement = useMemo(() => <TabActions />, [TabActions]);
|
||||||
|
|||||||
Reference in New Issue
Block a user