mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 05:40:31 +00:00
refactor: HOCs named imports
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
import React from 'react';
|
||||
import * as R from 'ramda';
|
||||
import { Drawer, DrawerSuspense } from '@/components';
|
||||
import withDrawers from '@/containers/Drawer/withDrawers';
|
||||
import { withDrawers } from '@/containers/Drawer/withDrawers';
|
||||
|
||||
const EstimateCustomizeDrawerBody = React.lazy(
|
||||
() => import('./EstimateCustomizeDrawerBody'),
|
||||
|
||||
@@ -22,8 +22,8 @@ import {
|
||||
EstimateSyncAutoExRateToForm,
|
||||
} from './components';
|
||||
|
||||
import withSettings from '@/containers/Settings/withSettings';
|
||||
import withCurrentOrganization from '@/containers/Organization/withCurrentOrganization';
|
||||
import { withSettings } from '@/containers/Settings/withSettings';
|
||||
import { withCurrentOrganization } from '@/containers/Organization/withCurrentOrganization';
|
||||
|
||||
import { AppToaster } from '@/components';
|
||||
import { compose, transactionNumber, orderingLinesIndexes } from '@/utils';
|
||||
|
||||
@@ -10,8 +10,8 @@ import {
|
||||
Icon,
|
||||
InputPrependButton,
|
||||
} from '@/components';
|
||||
import withDialogActions from '@/containers/Dialog/withDialogActions';
|
||||
import withSettings from '@/containers/Settings/withSettings';
|
||||
import { withDialogActions } from '@/containers/Dialog/withDialogActions';
|
||||
import { withSettings } from '@/containers/Settings/withSettings';
|
||||
|
||||
/**
|
||||
* Estimate number field of estimate form.
|
||||
|
||||
@@ -9,13 +9,13 @@ import { useCurrentOrganization } from '@/hooks/state';
|
||||
import { useEstimateIsForeignCustomer, useEstimateSubtotal } from './utils';
|
||||
import { transactionNumber } from '@/utils';
|
||||
import { useUpdateEffect } from '@/hooks';
|
||||
import withSettings from '@/containers/Settings/withSettings';
|
||||
import { withSettings } from '@/containers/Settings/withSettings';
|
||||
import {
|
||||
useSyncExRateToForm,
|
||||
withExchangeRateFetchingLoading,
|
||||
withExchangeRateItemEntriesPriceRecalc,
|
||||
} from '@/containers/Entries/withExRateItemEntriesPriceRecalc';
|
||||
import withDialogActions from '@/containers/Dialog/withDialogActions';
|
||||
import { withDialogActions } from '@/containers/Dialog/withDialogActions';
|
||||
import { DialogsName } from '@/constants/dialogs';
|
||||
|
||||
/**
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import React from 'react';
|
||||
import * as R from 'ramda';
|
||||
import { Drawer, DrawerSuspense } from '@/components';
|
||||
import withDrawers from '@/containers/Drawer/withDrawers';
|
||||
import { withDrawers } from '@/containers/Drawer/withDrawers';
|
||||
|
||||
const EstimateSendMailContent = React.lazy(() =>
|
||||
import('./EstimateSendMailContent').then((module) => ({
|
||||
|
||||
@@ -7,7 +7,7 @@ import { Choose, T, Icon } from '@/components';
|
||||
import { RESOURCES_TYPES } from '@/constants/resourcesTypes';
|
||||
import { AbilitySubject, SaleEstimateAction } from '@/constants/abilityOption';
|
||||
|
||||
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
||||
import { withDrawerActions } from '@/containers/Drawer/withDrawerActions';
|
||||
import { DRAWERS } from '@/constants/drawers';
|
||||
|
||||
/**
|
||||
|
||||
@@ -28,11 +28,11 @@ import {
|
||||
FSelect,
|
||||
} from '@/components';
|
||||
|
||||
import withEstimates from './withEstimates';
|
||||
import withEstimatesActions from './withEstimatesActions';
|
||||
import withSettings from '@/containers/Settings/withSettings';
|
||||
import withSettingsActions from '@/containers/Settings/withSettingsActions';
|
||||
import withDialogActions from '@/containers/Dialog/withDialogActions';
|
||||
import { withEstimates } from './withEstimates';
|
||||
import { withEstimatesActions } from './withEstimatesActions';
|
||||
import { withSettings } from '@/containers/Settings/withSettings';
|
||||
import { withSettingsActions } from '@/containers/Settings/withSettingsActions';
|
||||
import { withDialogActions } from '@/containers/Dialog/withDialogActions';
|
||||
|
||||
import { useEstimatesListContext } from './EstimatesListProvider';
|
||||
import {
|
||||
@@ -44,7 +44,7 @@ import { useBulkDeleteEstimatesDialog } from './hooks/use-bulk-delete-estimates-
|
||||
import { SaleEstimateAction, AbilitySubject } from '@/constants/abilityOption';
|
||||
import { compose } from '@/utils';
|
||||
import { DialogsName } from '@/constants/dialogs';
|
||||
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
||||
import { withDrawerActions } from '@/containers/Drawer/withDrawerActions';
|
||||
import { DRAWERS } from '@/constants/drawers';
|
||||
import { isEmpty } from 'lodash';
|
||||
import {
|
||||
|
||||
@@ -4,12 +4,12 @@ import { useHistory } from 'react-router-dom';
|
||||
|
||||
import EstimatesEmptyStatus from './EstimatesEmptyStatus';
|
||||
|
||||
import withEstimatesActions from './withEstimatesActions';
|
||||
import withAlertsActions from '@/containers/Alert/withAlertActions';
|
||||
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
||||
import withDialogActions from '@/containers/Dialog/withDialogActions';
|
||||
import withSettings from '@/containers/Settings/withSettings';
|
||||
import withEstimates from './withEstimates';
|
||||
import { withEstimatesActions } from './withEstimatesActions';
|
||||
import { withAlertActions } from '@/containers/Alert/withAlertActions';
|
||||
import { withDrawerActions } from '@/containers/Drawer/withDrawerActions';
|
||||
import { withDialogActions } from '@/containers/Dialog/withDialogActions';
|
||||
import { withSettings } from '@/containers/Settings/withSettings';
|
||||
import { withEstimates } from './withEstimates';
|
||||
|
||||
import { TABLES } from '@/constants/tables';
|
||||
import {
|
||||
@@ -33,7 +33,7 @@ function EstimatesDataTable({
|
||||
setEstimatesTableState,
|
||||
setEstimatesSelectedRows,
|
||||
|
||||
// #withAlertsActions
|
||||
// #withAlertActions
|
||||
openAlert,
|
||||
|
||||
// #withDrawerActions
|
||||
@@ -185,7 +185,7 @@ function EstimatesDataTable({
|
||||
|
||||
export default compose(
|
||||
withEstimatesActions,
|
||||
withAlertsActions,
|
||||
withAlertActions,
|
||||
withDrawerActions,
|
||||
withDialogActions,
|
||||
withSettings(({ estimatesSettings }) => ({
|
||||
|
||||
@@ -7,8 +7,8 @@ import '@/style/pages/SaleEstimate/List.scss';
|
||||
import EstimatesActionsBar from './EstimatesActionsBar';
|
||||
import EstimatesDataTable from './EstimatesDataTable';
|
||||
|
||||
import withEstimates from './withEstimates';
|
||||
import withEstimatesActions from './withEstimatesActions';
|
||||
import { withEstimates } from './withEstimates';
|
||||
import { withEstimatesActions } from './withEstimatesActions';
|
||||
|
||||
import { EstimatesListProvider } from './EstimatesListProvider';
|
||||
import { compose, transformTableStateToQuery } from '@/utils';
|
||||
|
||||
@@ -4,8 +4,8 @@ import { Alignment, Navbar, NavbarGroup } from '@blueprintjs/core';
|
||||
|
||||
import { DashboardViewsTabs } from '@/components';
|
||||
|
||||
import withEstimatesActions from './withEstimatesActions';
|
||||
import withEstimates from './withEstimates';
|
||||
import { withEstimatesActions } from './withEstimatesActions';
|
||||
import { withEstimates } from './withEstimates';
|
||||
|
||||
import { useEstimatesListContext } from './EstimatesListProvider';
|
||||
import { compose, transfromViewsToTabs } from '@/utils';
|
||||
|
||||
@@ -6,7 +6,7 @@ import {
|
||||
getEstimatesSelectedRowsFactory,
|
||||
} from '@/store/Estimate/estimates.selectors';
|
||||
|
||||
export default (mapState) => {
|
||||
export const withEstimates = (mapState) => {
|
||||
const getEstimatesTableState = getEstimatesTableStateFactory();
|
||||
const getSelectedRows = getEstimatesSelectedRowsFactory();
|
||||
const isEstimatesTableStateChanged = isEstimatesTableStateChangedFactory();
|
||||
|
||||
@@ -12,4 +12,4 @@ const mapDispatchToProps = (dispatch) => ({
|
||||
setEstimatesSelectedRows: (selectedRows) => dispatch(setEstimatesSelectedRows(selectedRows)),
|
||||
});
|
||||
|
||||
export default connect(null, mapDispatchToProps);
|
||||
export const withEstimatesActions = connect(null, mapDispatchToProps);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { getEstimateByIdFactory } from '@/store/Estimate/estimates.selectors';
|
||||
|
||||
export default () => {
|
||||
export const withEstimateDetail = () => {
|
||||
const getEstimateById = getEstimateByIdFactory();
|
||||
|
||||
const mapStateToProps = (state, props) => ({
|
||||
|
||||
Reference in New Issue
Block a user