mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 13:50:31 +00:00
refactor: HOCs named imports
This commit is contained in:
@@ -21,9 +21,9 @@ import { PaymentMadeInnerProvider } from './PaymentMadeInnerProvider';
|
||||
import { usePaymentMadeFormContext } from './PaymentMadeFormProvider';
|
||||
import { compose, orderingLinesIndexes } from '@/utils';
|
||||
|
||||
import withSettings from '@/containers/Settings/withSettings';
|
||||
import withCurrentOrganization from '@/containers/Organization/withCurrentOrganization';
|
||||
import withDialogActions from '@/containers/Dialog/withDialogActions';
|
||||
import { withSettings } from '@/containers/Settings/withSettings';
|
||||
import { withCurrentOrganization } from '@/containers/Organization/withCurrentOrganization';
|
||||
import { withDialogActions } from '@/containers/Dialog/withDialogActions';
|
||||
import { PageForm } from '@/components/PageForm';
|
||||
|
||||
import {
|
||||
|
||||
@@ -36,7 +36,7 @@ import {
|
||||
Icon,
|
||||
VendorDrawerLink,
|
||||
} from '@/components';
|
||||
import withCurrentOrganization from '@/containers/Organization/withCurrentOrganization';
|
||||
import { withCurrentOrganization } from '@/containers/Organization/withCurrentOrganization';
|
||||
import { usePaymentMadeFormContext } from './PaymentMadeFormProvider';
|
||||
import { ACCOUNT_TYPE } from '@/constants/accountTypes';
|
||||
import { PaymentMadeExchangeRateInputField } from './components';
|
||||
|
||||
@@ -5,7 +5,7 @@ import { Button, Classes, Intent } from '@blueprintjs/core';
|
||||
import { Form, Formik, FormikHelpers, useFormikContext } from 'formik';
|
||||
import { FormatNumber } from '@/components';
|
||||
import { usePaymentMadeFormContext } from '../../PaymentMadeFormProvider';
|
||||
import withDialogActions from '@/containers/Dialog/withDialogActions';
|
||||
import { withDialogActions } from '@/containers/Dialog/withDialogActions';
|
||||
import { usePaymentMadeExcessAmount } from '../../utils';
|
||||
|
||||
interface ExcessPaymentValues {}
|
||||
|
||||
@@ -23,11 +23,11 @@ import {
|
||||
} from '@/components';
|
||||
import { PaymentMadeAction, AbilitySubject } from '@/constants/abilityOption';
|
||||
|
||||
import withPaymentMade from './withPaymentMade';
|
||||
import withPaymentMadeActions from './withPaymentMadeActions';
|
||||
import withSettings from '@/containers/Settings/withSettings';
|
||||
import withSettingsActions from '@/containers/Settings/withSettingsActions';
|
||||
import withDialogActions from '@/containers/Dialog/withDialogActions';
|
||||
import { withPaymentMade } from './withPaymentMade';
|
||||
import { withPaymentMadeActions } from './withPaymentMadeActions';
|
||||
import { withSettings } from '@/containers/Settings/withSettings';
|
||||
import { withSettingsActions } from '@/containers/Settings/withSettingsActions';
|
||||
import { withDialogActions } from '@/containers/Dialog/withDialogActions';
|
||||
|
||||
import { usePaymentMadesListContext } from './PaymentMadesListProvider';
|
||||
import { useRefreshPaymentMades } from '@/hooks/query/paymentMades';
|
||||
|
||||
@@ -8,8 +8,8 @@ import { PaymentMadesListProvider } from './PaymentMadesListProvider';
|
||||
import PaymentMadeActionsBar from './PaymentMadeActionsBar';
|
||||
import PaymentMadesTable from './PaymentMadesTable';
|
||||
|
||||
import withPaymentMades from './withPaymentMade';
|
||||
import withPaymentMadeActions from './withPaymentMadeActions';
|
||||
import { withPaymentMades } from './withPaymentMade';
|
||||
import { withPaymentMadeActions } from './withPaymentMadeActions';
|
||||
|
||||
import { compose, transformTableStateToQuery } from '@/utils';
|
||||
|
||||
|
||||
@@ -8,8 +8,8 @@ import { compose } from '@/utils';
|
||||
import { usePaymentMadesListContext } from './PaymentMadesListProvider';
|
||||
import { transformPaymentViewsToTabs } from './utils';
|
||||
|
||||
import withPaymentMade from './withPaymentMade';
|
||||
import withPaymentMadeActions from './withPaymentMadeActions';
|
||||
import { withPaymentMade } from './withPaymentMade';
|
||||
import { withPaymentMadeActions } from './withPaymentMadeActions';
|
||||
|
||||
/**
|
||||
* Payment made views tabs.
|
||||
|
||||
@@ -13,12 +13,12 @@ import {
|
||||
|
||||
import PaymentMadesEmptyStatus from './PaymentMadesEmptyStatus';
|
||||
|
||||
import withPaymentMade from './withPaymentMade';
|
||||
import withPaymentMadeActions from './withPaymentMadeActions';
|
||||
import withCurrentOrganization from '@/containers/Organization/withCurrentOrganization';
|
||||
import withAlertsActions from '@/containers/Alert/withAlertActions';
|
||||
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
||||
import withSettings from '@/containers/Settings/withSettings';
|
||||
import { withPaymentMade } from './withPaymentMade';
|
||||
import { withPaymentMadeActions } from './withPaymentMadeActions';
|
||||
import { withCurrentOrganization } from '@/containers/Organization/withCurrentOrganization';
|
||||
import { withAlertActions } from '@/containers/Alert/withAlertActions';
|
||||
import { withDrawerActions } from '@/containers/Drawer/withDrawerActions';
|
||||
import { withSettings } from '@/containers/Settings/withSettings';
|
||||
|
||||
import { usePaymentMadesTableColumns, ActionsMenu } from './components';
|
||||
import { usePaymentMadesListContext } from './PaymentMadesListProvider';
|
||||
@@ -136,7 +136,7 @@ function PaymentMadesTable({
|
||||
export default compose(
|
||||
withPaymentMadeActions,
|
||||
withPaymentMade(({ paymentMadesTableState }) => ({ paymentMadesTableState })),
|
||||
withAlertsActions,
|
||||
withAlertActions,
|
||||
withDrawerActions,
|
||||
withCurrentOrganization(),
|
||||
withSettings(({ billPaymentSettings }) => ({
|
||||
|
||||
@@ -4,8 +4,8 @@ import { Switch, Route } from 'react-router-dom';
|
||||
|
||||
import PaymentMadeViewTabs from './PaymentMadeViewTabs';
|
||||
|
||||
import withAlertsActions from '@/containers/Alert/withAlertActions';
|
||||
import withDialogActions from '@/containers/Dialog/withDialogActions';
|
||||
import { withAlertActions } from '@/containers/Alert/withAlertActions';
|
||||
import { withDialogActions } from '@/containers/Dialog/withDialogActions';
|
||||
|
||||
import { compose } from '@/utils';
|
||||
|
||||
@@ -22,7 +22,7 @@ function PaymentMadesViewPage({
|
||||
exact={true}
|
||||
path={['/payments-made/:custom_view_id/custom_view', '/payments-made']}
|
||||
>
|
||||
|
||||
|
||||
{/* <PaymentMadeDataTable
|
||||
onDeletePaymentMade={handleDeletePaymentMade}
|
||||
onEditPaymentMade={handleEditPaymentMade}
|
||||
@@ -34,6 +34,6 @@ function PaymentMadesViewPage({
|
||||
}
|
||||
|
||||
export default compose(
|
||||
withAlertsActions,
|
||||
withAlertActions,
|
||||
withDialogActions,
|
||||
)(PaymentMadesViewPage);
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
paymentsTableStateChangedFactory,
|
||||
} from '@/store/PaymentMades/paymentMades.selector';
|
||||
|
||||
export default (mapState) => {
|
||||
export const withPaymentMade = (mapState) => {
|
||||
const getPaymentMadesTableState = getPaymentMadesTableStateFactory();
|
||||
const paymentsTableStateChanged = paymentsTableStateChangedFactory();
|
||||
|
||||
|
||||
@@ -11,4 +11,4 @@ const mapDispatchToProps = (dispatch) => ({
|
||||
|
||||
resetPaymentMadesTableState: () => dispatch(resetPaymentMadesTableState()),
|
||||
});
|
||||
export default connect(null, mapDispatchToProps);
|
||||
export const withPaymentMadeActions = connect(null, mapDispatchToProps);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { getPaymentMadeByIdFactory } from '@/store/PaymentMades/paymentMade.selector';
|
||||
|
||||
export default () => {
|
||||
export const withPaymentMadeDetail = () => {
|
||||
const getPaymentMadeById = getPaymentMadeByIdFactory();
|
||||
|
||||
const mapStateToProps = (state, props) => ({
|
||||
|
||||
@@ -8,7 +8,7 @@ import { RESOURCES_TYPES } from '@/constants/resourcesTypes';
|
||||
import { highlightText } from '@/utils';
|
||||
import { AbilitySubject, PaymentMadeAction } from '@/constants/abilityOption';
|
||||
import { DRAWERS } from '@/constants/drawers';
|
||||
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
||||
import { withDrawerActions } from '@/containers/Drawer/withDrawerActions';
|
||||
|
||||
/**
|
||||
* Universal search bill item select action.
|
||||
|
||||
Reference in New Issue
Block a user