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:
@@ -5,8 +5,8 @@ import { Redirect } from 'react-router-dom';
|
||||
import { BillingPageBoot } from './BillingPageBoot';
|
||||
import { BillingPageContent } from './BillingPageContent';
|
||||
import { useDashboardMeta } from '@/hooks/query';
|
||||
import withAlertActions from '../Alert/withAlertActions';
|
||||
import withDashboardActions from '../Dashboard/withDashboardActions';
|
||||
import { withAlertActions } from '../Alert/withAlertActions';
|
||||
import { withDashboardActions } from '../Dashboard/withDashboardActions';
|
||||
|
||||
function BillingPageRoot({
|
||||
openAlert,
|
||||
|
||||
@@ -4,9 +4,9 @@ import clsx from 'classnames';
|
||||
import { includes } from 'lodash';
|
||||
import { Box, Group, Stack } from '@/components';
|
||||
import { Button, Card, Classes, Intent, Text } from '@blueprintjs/core';
|
||||
import withAlertActions from '../Alert/withAlertActions';
|
||||
import { withAlertActions } from '../Alert/withAlertActions';
|
||||
import styles from './BillingSubscription.module.scss';
|
||||
import withDrawerActions from '../Drawer/withDrawerActions';
|
||||
import { withDrawerActions } from '../Drawer/withDrawerActions';
|
||||
import { DRAWERS } from '@/constants/drawers';
|
||||
import { useBillingPageBoot } from './BillingPageBoot';
|
||||
import { getSubscriptionStatusText } from './_utils';
|
||||
|
||||
@@ -4,8 +4,8 @@ import * as R from 'ramda';
|
||||
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 { useCancelMainSubscription } from '@/hooks/query/subscription';
|
||||
|
||||
|
||||
@@ -4,8 +4,8 @@ import * as R from 'ramda';
|
||||
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 { useResumeMainSubscription } from '@/hooks/query/subscription';
|
||||
|
||||
/**
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import React, { lazy } from 'react';
|
||||
import * as R from 'ramda';
|
||||
import { Drawer, DrawerHeaderContent, DrawerSuspense } from '@/components';
|
||||
import withDrawers from '@/containers/Drawer/withDrawers';
|
||||
import { withDrawers } from '@/containers/Drawer/withDrawers';
|
||||
import { Position } from '@blueprintjs/core';
|
||||
import { DRAWERS } from '@/constants/drawers';
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ import { useSubscriptionPlans } from '@/hooks/constants/useSubscriptionPlans';
|
||||
import { useChangeSubscriptionPlan } from '@/hooks/query/subscription';
|
||||
import { withSubscriptionPlanMapper } from '../../component/withSubscriptionPlanMapper';
|
||||
import { withPlans } from '../../withPlans';
|
||||
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
|
||||
import { withDrawerActions } from '@/containers/Drawer/withDrawerActions';
|
||||
import { DRAWERS } from '@/constants/drawers';
|
||||
|
||||
export function ChangeSubscriptionPlans() {
|
||||
|
||||
@@ -6,4 +6,4 @@ export const mapDispatchToProps = (dispatch) => ({
|
||||
requestSubmitBilling: (form) => dispatch(submitBilling({ form })),
|
||||
});
|
||||
|
||||
export default connect(null, mapDispatchToProps);
|
||||
export const withBillingActions = connect(null, mapDispatchToProps);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { getPlanSelector } from '@/store/plans/plans.selectors';
|
||||
|
||||
export default (mapState) => {
|
||||
export const withPlan = (mapState) => {
|
||||
const mapStateToProps = (state, props) => {
|
||||
const getPlan = getPlanSelector();
|
||||
|
||||
|
||||
@@ -19,4 +19,4 @@ export const mapDispatchToProps: MapDispatchToProps<
|
||||
dispatch(changePlansPeriod({ period })),
|
||||
});
|
||||
|
||||
export default connect(null, mapDispatchToProps);
|
||||
export const withSubscriptionPlansActions = connect(null, mapDispatchToProps);
|
||||
|
||||
@@ -6,7 +6,7 @@ import {
|
||||
isSubscriptionActiveFactory,
|
||||
} from '@/store/subscription/subscription.selectors';
|
||||
|
||||
export default (mapState, slug) => {
|
||||
export const withSubscriptions = (mapState, slug) => {
|
||||
const isSubscriptionOnTrial = isSubscriptionOnTrialFactory(slug);
|
||||
const isSubscriptionInactive = isSubscriptionInactiveFactory(slug);
|
||||
const isSubscriptionActive = isSubscriptionActiveFactory(slug);
|
||||
|
||||
@@ -6,4 +6,4 @@ const mapDispatchToProps = (dispatch) => ({
|
||||
requestFetchSubscriptions: () => dispatch(fetchSubscriptions()),
|
||||
});
|
||||
|
||||
export default connect(null, mapDispatchToProps);
|
||||
export const withSubscriptionsActions = connect(null, mapDispatchToProps);
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
isSubscriptionsActiveFactory,
|
||||
} from '@/store/subscription/subscription.selectors';
|
||||
|
||||
export default (mapState) => {
|
||||
export const withSubscriptionss = (mapState) => {
|
||||
const isSubscriptionsInactive = isSubscriptionsInactiveFactory();
|
||||
const isSubscriptionsActive = isSubscriptionsActiveFactory();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user