refactor: HOCs named imports

This commit is contained in:
Ahmed Bouhuolia
2026-01-01 21:58:42 +02:00
parent 5d872798ff
commit 0f377e19f3
712 changed files with 1367 additions and 1360 deletions

View File

@@ -37,12 +37,12 @@ import { useAccountTransactionsContext } from './AccountTransactionsProvider';
import { useMediaQuery } from '@/hooks/useMediaQuery';
import { useAppShellContext } from '@/components/AppShell/AppContentShell/AppContentShellProvider';
import withDialogActions from '@/containers/Dialog/withDialogActions';
import withSettings from '@/containers/Settings/withSettings';
import withSettingsActions from '@/containers/Settings/withSettingsActions';
import { withDialogActions } from '@/containers/Dialog/withDialogActions';
import { withSettings } from '@/containers/Settings/withSettings';
import { withSettingsActions } from '@/containers/Settings/withSettingsActions';
import { withBankingActions } from '../withBankingActions';
import { withBanking } from '../withBanking';
import withAlertActions from '@/containers/Alert/withAlertActions';
import { withAlertActions } from '@/containers/Alert/withAlertActions';
import {
useUpdateBankAccount,
useExcludeUncategorizedTransactions,

View File

@@ -14,9 +14,9 @@ import {
} from '@/components';
import { TABLES } from '@/constants/tables';
import withSettings from '@/containers/Settings/withSettings';
import withAlertsActions from '@/containers/Alert/withAlertActions';
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
import { withSettings } from '@/containers/Settings/withSettings';
import { withAlertActions } from '@/containers/Alert/withAlertActions';
import { withDrawerActions } from '@/containers/Drawer/withDrawerActions';
import { withBankingActions } from '../withBankingActions';
import { useMemorizedColumnsWidths } from '@/hooks';
@@ -36,7 +36,7 @@ function AccountTransactionsDataTable({
// #withSettings
cashflowTansactionsTableSize,
// #withAlertsActions
// #withAlertActions
openAlert,
// #withDrawerActions
@@ -157,7 +157,7 @@ export default compose(
withSettings(({ cashflowTransactionsSettings }) => ({
cashflowTansactionsTableSize: cashflowTransactionsSettings?.tableSize,
})),
withAlertsActions,
withAlertActions,
withDrawerActions,
withBankingActions,
)(AccountTransactionsDataTable);

View File

@@ -6,7 +6,7 @@ import {
TableSkeletonHeader,
TableVirtualizedListRows,
} from '@/components';
import withSettings from '@/containers/Settings/withSettings';
import { withSettings } from '@/containers/Settings/withSettings';
import { withBankingActions } from '../../withBankingActions';
import { useAccountTransactionsContext } from '../AccountTransactionsProvider';

View File

@@ -13,7 +13,7 @@ import { TABLES } from '@/constants/tables';
import { ActionsMenu } from './components';
import { BankAccountDataTable } from '../components/BankAccountDataTable';
import withSettings from '@/containers/Settings/withSettings';
import { withSettings } from '@/containers/Settings/withSettings';
import { withBankingActions } from '../../withBankingActions';
import { withBanking } from '../../withBanking';

View File

@@ -3,8 +3,8 @@ import React from 'react';
import { Intent, Alert } from '@blueprintjs/core';
import { AppToaster, FormattedMessage as T } from '@/components';
import withAlertStoreConnect from '@/containers/Alert/withAlertStoreConnect';
import withAlertActions from '@/containers/Alert/withAlertActions';
import { withAlertStoreConnect } from '@/containers/Alert/withAlertStoreConnect';
import { withAlertActions } from '@/containers/Alert/withAlertActions';
import { usePauseFeedsBankAccount } from '@/hooks/query/bank-accounts';
import { compose } from '@/utils';

View File

@@ -3,8 +3,8 @@ import React from 'react';
import { Intent, Alert } from '@blueprintjs/core';
import { AppToaster, FormattedMessage as T } from '@/components';
import withAlertStoreConnect from '@/containers/Alert/withAlertStoreConnect';
import withAlertActions from '@/containers/Alert/withAlertActions';
import { withAlertStoreConnect } from '@/containers/Alert/withAlertStoreConnect';
import { withAlertActions } from '@/containers/Alert/withAlertActions';
import { useResumeFeedsBankAccount } from '@/hooks/query/bank-accounts';
import { compose } from '@/utils';

View File

@@ -3,8 +3,8 @@ import React from 'react';
import { Intent, Alert } from '@blueprintjs/core';
import { AppToaster, FormattedMessage as T } from '@/components';
import withAlertStoreConnect from '@/containers/Alert/withAlertStoreConnect';
import withAlertActions from '@/containers/Alert/withAlertActions';
import { withAlertStoreConnect } from '@/containers/Alert/withAlertStoreConnect';
import { withAlertActions } from '@/containers/Alert/withAlertActions';
import { useUncategorizeTransactionsBulkAction } from '@/hooks/query/bank-transactions';
import { compose } from '@/utils';

View File

@@ -5,7 +5,7 @@ import * as R from 'ramda';
import { Form, Formik, FormikHelpers } from 'formik';
import { AppToaster, FFormGroup, FInputGroup } from '@/components';
import { useDisconnectBankAccount } from '@/hooks/query/bank-rules';
import withDialogActions from '@/containers/Dialog/withDialogActions';
import { withDialogActions } from '@/containers/Dialog/withDialogActions';
import { DialogsName } from '@/constants/dialogs';
interface DisconnectFormValues {

View File

@@ -2,7 +2,7 @@
import { connect } from 'react-redux';
import { getCashflowAccountsTableStateFactory } from '@/store/CashflowAccounts/CashflowAccounts.selectors';
export default (mapState) => {
export const withCashflowAccounts = (mapState) => {
const getCashflowAccountsTableState = getCashflowAccountsTableStateFactory();
const mapStateToProps = (state, props) => {

View File

@@ -13,4 +13,4 @@ const mapActionsToProps = (dispatch) => ({
dispatch(resetCashflowAccountsTableState()),
});
export default connect(null, mapActionsToProps);
export const withCashflowAccountsTableActions = connect(null, mapActionsToProps);

View File

@@ -18,8 +18,8 @@ import { useRefreshCashflowAccounts } from '@/hooks/query';
import { useOpenPlaidConnect } from '@/hooks/utils/useOpenPlaidConnect';
import { CashflowAction, AbilitySubject } from '@/constants/abilityOption';
import withDialogActions from '@/containers/Dialog/withDialogActions';
import withCashflowAccountsTableActions from '../AccountTransactions/withCashflowAccountsTableActions';
import { withDialogActions } from '@/containers/Dialog/withDialogActions';
import { withCashflowAccountsTableActions } from '../AccountTransactions/withCashflowAccountsTableActions';
import { AccountDialogAction } from '@/containers/Dialogs/AccountDialog/utils';

View File

@@ -9,7 +9,7 @@ import {
TableSkeletonHeader,
} from '@/components';
import withSettings from '@/containers/Settings/withSettings';
import { withSettings } from '@/containers/Settings/withSettings';
import { useMemorizedColumnsWidths } from '@/hooks';
import { useCashFlowAccountsContext } from './CashFlowAccountsProvider';

View File

@@ -12,8 +12,8 @@ import CashFlowAccountsActionsBar from './CashFlowAccountsActionsBar';
import { CashflowAccountsPlaidLink } from './CashflowAccountsPlaidLink';
import { CashflowAccountsLoadingBar } from './CashFlowAccountsLoadingBar';
import withCashflowAccounts from '@/containers/CashFlow/AccountTransactions/withCashflowAccounts';
import withCashflowAccountsTableActions from '@/containers/CashFlow/AccountTransactions/withCashflowAccountsTableActions';
import { withCashflowAccounts } from '@/containers/CashFlow/AccountTransactions/withCashflowAccounts';
import { withCashflowAccountsTableActions } from '@/containers/CashFlow/AccountTransactions/withCashflowAccountsTableActions';
/**
* Cashflow accounts list.

View File

@@ -22,9 +22,9 @@ import {
import { BankAccountsList, BankAccount, If, Icon, T, Can } from '@/components';
import { useCashFlowAccountsContext } from './CashFlowAccountsProvider';
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
import withAlertsActions from '@/containers/Alert/withAlertActions';
import withDialogActions from '@/containers/Dialog/withDialogActions';
import { withDrawerActions } from '@/containers/Drawer/withDrawerActions';
import { withAlertActions } from '@/containers/Alert/withAlertActions';
import { withDialogActions } from '@/containers/Dialog/withDialogActions';
import { AccountDialogAction } from '@/containers/Dialogs/AccountDialog/utils';
import { safeCallback } from '@/utils';
@@ -136,7 +136,7 @@ function CashflowBankAccount({
}
const CashflowBankAccountEnhanced = compose(
withAlertsActions,
withAlertActions,
withDrawerActions,
withDialogActions,
)(CashflowBankAccount);

View File

@@ -1,7 +1,7 @@
// @ts-nocheck
import React, { lazy } from 'react';
import { Drawer, DrawerSuspense } from '@/components';
import withDrawers from '@/containers/Drawer/withDrawers';
import { withDrawers } from '@/containers/Drawer/withDrawers';
import { compose } from '@/utils';

View File

@@ -6,7 +6,7 @@ import { FormattedMessage as T } from '@/components';
import { useMoneyInDailogContext } from './MoneyInDialogProvider';
import withDialogActions from '@/containers/Dialog/withDialogActions';
import { withDialogActions } from '@/containers/Dialog/withDialogActions';
import { compose } from '@/utils';
/**

View File

@@ -15,9 +15,9 @@ import { CreateMoneyInFormSchema } from './MoneyInForm.schema';
import { useMoneyInDailogContext } from './MoneyInDialogProvider';
import withSettings from '@/containers/Settings/withSettings';
import withDialogActions from '@/containers/Dialog/withDialogActions';
import withCurrentOrganization from '@/containers/Organization/withCurrentOrganization';
import { withSettings } from '@/containers/Settings/withSettings';
import { withDialogActions } from '@/containers/Dialog/withDialogActions';
import { withCurrentOrganization } from '@/containers/Organization/withCurrentOrganization';
import { compose, transactionNumber } from '@/utils';

View File

@@ -6,7 +6,7 @@ import { FormattedMessage as T } from '@/components';
import { useMoneyOutDialogContext } from './MoneyOutDialogProvider';
import withDialogActions from '@/containers/Dialog/withDialogActions';
import { withDialogActions } from '@/containers/Dialog/withDialogActions';
import { compose } from '@/utils';

View File

@@ -15,9 +15,9 @@ import { CreateMoneyOutSchema } from './MoneyOutForm.schema';
import { useMoneyOutDialogContext } from './MoneyOutDialogProvider';
import withSettings from '@/containers/Settings/withSettings';
import withDialogActions from '@/containers/Dialog/withDialogActions';
import withCurrentOrganization from '@/containers/Organization/withCurrentOrganization';
import { withSettings } from '@/containers/Settings/withSettings';
import { withDialogActions } from '@/containers/Dialog/withDialogActions';
import { withCurrentOrganization } from '@/containers/Organization/withCurrentOrganization';
import { compose, transactionNumber } from '@/utils';

View File

@@ -4,9 +4,9 @@ import { Intent, Alert } from '@blueprintjs/core';
import { FormattedMessage as T } from '@/components';
import { AppToaster } from '@/components';
import withAlertStoreConnect from '@/containers/Alert/withAlertStoreConnect';
import withAlertActions from '@/containers/Alert/withAlertActions';
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
import { withAlertStoreConnect } from '@/containers/Alert/withAlertStoreConnect';
import { withAlertActions } from '@/containers/Alert/withAlertActions';
import { withDrawerActions } from '@/containers/Drawer/withDrawerActions';
import { useUncategorizeTransaction } from '@/hooks/query';
import { compose } from '@/utils';

View File

@@ -12,8 +12,8 @@ import {
} from '@/components';
import { useUpdateEffect } from '@/hooks';
import withSettings from '@/containers/Settings/withSettings';
import withDialogActions from '@/containers/Dialog/withDialogActions';
import { withSettings } from '@/containers/Settings/withSettings';
import { withDialogActions } from '@/containers/Dialog/withDialogActions';
import { transactionNumber } from '@/utils';
/**