mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-20 13:32:00 +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 = () => {
|
||||
filterModal.openModal();
|
||||
formik.validateForm();
|
||||
@@ -360,15 +359,12 @@ const CustomerPaymentTab = ({ tabId }: CustomerPaymentTabProps) => {
|
||||
(state) => state.clearTabActions
|
||||
);
|
||||
|
||||
const formikValuesRef = useRef(formik.values);
|
||||
formikValuesRef.current = formik.values;
|
||||
|
||||
useEffect(() => {
|
||||
setTabActions(
|
||||
tabId,
|
||||
<div className='flex flex-row gap-3'>
|
||||
<ButtonFilter
|
||||
values={formikValuesRef.current}
|
||||
values={filterParams}
|
||||
fieldGroups={[['start_date', 'end_date']]}
|
||||
onClick={() => handleFilterModalOpenRef.current()}
|
||||
variant='outline'
|
||||
@@ -449,7 +445,7 @@ const CustomerPaymentTab = ({ tabId }: CustomerPaymentTabProps) => {
|
||||
handleExportPdf,
|
||||
isExcelExportLoading,
|
||||
isPdfExportLoading,
|
||||
formik.values,
|
||||
filterParams,
|
||||
]);
|
||||
|
||||
const TabActionsElement = useMemo(() => <TabActions />, [TabActions]);
|
||||
|
||||
Reference in New Issue
Block a user