mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-27 18:19:48 +00:00
refactor: HOCs named imports
This commit is contained in:
@@ -18,7 +18,7 @@ import VendorFormPrimarySection from './VendorFormPrimarySection';
|
||||
import VendorFormAfterPrimarySection from './VendorFormAfterPrimarySection';
|
||||
import VendorFloatingActions from './VendorFloatingActions';
|
||||
|
||||
import withCurrentOrganization from '@/containers/Organization/withCurrentOrganization';
|
||||
import { withCurrentOrganization } from '@/containers/Organization/withCurrentOrganization';
|
||||
|
||||
import { useVendorFormContext } from './VendorFormProvider';
|
||||
import { compose, transformToForm, safeInvoke } from '@/utils';
|
||||
|
||||
@@ -30,11 +30,11 @@ import { useDownloadExportPdf } from '@/hooks/query/FinancialReports/use-export-
|
||||
import { useBulkDeleteVendorsDialog } from './hooks/use-bulk-delete-vendors-dialog';
|
||||
import { isEmpty } from 'lodash';
|
||||
|
||||
import withVendors from './withVendors';
|
||||
import withVendorsActions from './withVendorsActions';
|
||||
import withSettings from '@/containers/Settings/withSettings';
|
||||
import withSettingsActions from '@/containers/Settings/withSettingsActions';
|
||||
import withDialogActions from '@/containers/Dialog/withDialogActions';
|
||||
import { withVendors } from './withVendors';
|
||||
import { withVendorsActions } from './withVendorsActions';
|
||||
import { withSettings } from '@/containers/Settings/withSettings';
|
||||
import { withSettingsActions } from '@/containers/Settings/withSettingsActions';
|
||||
import { withDialogActions } from '@/containers/Dialog/withDialogActions';
|
||||
|
||||
import { compose } from '@/utils';
|
||||
import { DialogsName } from '@/constants/dialogs';
|
||||
|
||||
@@ -4,8 +4,8 @@ import { Alignment, Navbar, NavbarGroup } from '@blueprintjs/core';
|
||||
import { useVendorsListContext } from './VendorsListProvider';
|
||||
import { DashboardViewsTabs } from '@/components';
|
||||
|
||||
import withVendorsActions from './withVendorsActions';
|
||||
import withVendors from './withVendors';
|
||||
import { withVendorsActions } from './withVendorsActions';
|
||||
import { withVendors } from './withVendors';
|
||||
|
||||
import { transfromViewsToTabs, compose } from '@/utils';
|
||||
|
||||
|
||||
@@ -9,8 +9,8 @@ import { VendorsListProvider } from './VendorsListProvider';
|
||||
import VendorActionsBar from './VendorActionsBar';
|
||||
import VendorsTable from './VendorsTable';
|
||||
|
||||
import withVendors from './withVendors';
|
||||
import withVendorsActions from './withVendorsActions';
|
||||
import { withVendors } from './withVendors';
|
||||
import { withVendorsActions } from './withVendorsActions';
|
||||
|
||||
import { compose } from '@/utils';
|
||||
|
||||
|
||||
@@ -15,12 +15,12 @@ import { useVendorsListContext } from './VendorsListProvider';
|
||||
import { useMemorizedColumnsWidths } from '@/hooks';
|
||||
import { ActionsMenu, useVendorsTableColumns } from './components';
|
||||
|
||||
import withVendors from './withVendors';
|
||||
import withVendorsActions from './withVendorsActions';
|
||||
import withAlertsActions from '@/containers/Alert/withAlertActions';
|
||||
import withDialogActions from '@/containers/Dialog/withDialogActions';
|
||||
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
||||
import withSettings from '@/containers/Settings/withSettings';
|
||||
import { withVendors } from './withVendors';
|
||||
import { withVendorsActions } from './withVendorsActions';
|
||||
import { withAlertActions } from '@/containers/Alert/withAlertActions';
|
||||
import { withDialogActions } from '@/containers/Dialog/withDialogActions';
|
||||
import { withDrawerActions } from '@/containers/Drawer/withDrawerActions';
|
||||
import { withSettings } from '@/containers/Settings/withSettings';
|
||||
|
||||
import { compose } from '@/utils';
|
||||
import { DRAWERS } from '@/constants/drawers';
|
||||
@@ -36,7 +36,7 @@ function VendorsTable({
|
||||
// #withVendors
|
||||
vendorsTableState,
|
||||
|
||||
// #withAlertsActions
|
||||
// #withAlertActions
|
||||
openAlert,
|
||||
|
||||
// #withDrawerActions
|
||||
@@ -175,7 +175,7 @@ function VendorsTable({
|
||||
|
||||
export default compose(
|
||||
withVendorsActions,
|
||||
withAlertsActions,
|
||||
withAlertActions,
|
||||
withDialogActions,
|
||||
withDrawerActions,
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
vendorsTableStateChangedFactory,
|
||||
} from '@/store/vendors/vendors.selectors';
|
||||
|
||||
export default (mapState) => {
|
||||
export const withVendors = (mapState) => {
|
||||
const getVendorsTableState = getVendorsTableStateFactory();
|
||||
const vendorsTableStateChanged = vendorsTableStateChangedFactory();
|
||||
|
||||
|
||||
@@ -15,4 +15,4 @@ const mapDispatchToProps = (dispatch) => ({
|
||||
resetVendorsSelectedRows: () => dispatch(resetVendorsSelectedRows()),
|
||||
});
|
||||
|
||||
export default connect(null, mapDispatchToProps);
|
||||
export const withVendorsActions = connect(null, mapDispatchToProps);
|
||||
|
||||
@@ -3,7 +3,7 @@ import intl from 'react-intl-universal';
|
||||
|
||||
import { RESOURCES_TYPES } from '@/constants/resourcesTypes';
|
||||
import { AbilitySubject, VendorAction } from '@/constants/abilityOption';
|
||||
import withDrawerActions from '../Drawer/withDrawerActions';
|
||||
import { withDrawerActions } from '../Drawer/withDrawerActions';
|
||||
import { DRAWERS } from '@/constants/drawers';
|
||||
|
||||
/**
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { getVendorByIdFactory } from '@/store/vendors/vendors.selectors';
|
||||
|
||||
export default () => {
|
||||
export const withVendorDetail = () => {
|
||||
const getVendorById = getVendorByIdFactory();
|
||||
const mapStateToProps = (state, props) => ({
|
||||
vendor: getVendorById(state, props),
|
||||
|
||||
Reference in New Issue
Block a user