mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 05:10:31 +00:00
feat: refactoring alerts.
This commit is contained in:
@@ -1,10 +1,6 @@
|
||||
import React from 'react';
|
||||
import CurrencyDeleteAlert from 'containers/Alerts/Currencies/CurrencyDeleteAlert';
|
||||
|
||||
export default function CurrenciesAlerts() {
|
||||
return (
|
||||
<div>
|
||||
<CurrencyDeleteAlert name={'currency-delete'} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
const CurrencyDeleteAlert = React.lazy(() =>
|
||||
import('../../Alerts/Currencies/CurrencyDeleteAlert'),
|
||||
);
|
||||
export default [{ name: 'currency-delete', component: CurrencyDeleteAlert }];
|
||||
|
||||
@@ -5,7 +5,6 @@ import intl from 'react-intl-universal';
|
||||
|
||||
import { CurrenciesProvider } from './CurrenciesProvider';
|
||||
import CurrenciesDataTable from './CurrenciesDataTable';
|
||||
import CurrenciesAlerts from './CurrenciesAlerts';
|
||||
|
||||
import withDashboardActions from 'containers/Dashboard/withDashboardActions';
|
||||
|
||||
@@ -22,7 +21,6 @@ function CurrenciesList({
|
||||
return (
|
||||
<CurrenciesProvider>
|
||||
<CurrenciesDataTable />
|
||||
<CurrenciesAlerts />
|
||||
</CurrenciesProvider>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,14 +1,17 @@
|
||||
import React from 'react';
|
||||
import UserDeleteAlert from 'containers/Alerts/Users/UserDeleteAlert';
|
||||
import UserInactivateAlert from 'containers/Alerts/Users/UserInactivateAlert';
|
||||
import UserActivateAlert from 'containers/Alerts/Users/UserActivateAlert';
|
||||
|
||||
export default function UsersAlerts() {
|
||||
return (
|
||||
<>
|
||||
<UserDeleteAlert name={'user-delete'} />
|
||||
<UserInactivateAlert name={'user-inactivate'} />
|
||||
<UserActivateAlert name={'user-activate'} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
const UserDeleteAlert = React.lazy(() =>
|
||||
import('../../Alerts/Users/UserDeleteAlert'),
|
||||
);
|
||||
const UserActivateAlert = React.lazy(() =>
|
||||
import('../../Alerts/Users/UserActivateAlert'),
|
||||
);
|
||||
const UserInactivateAlert = React.lazy(() =>
|
||||
import('../../Alerts/Users/UserInactivateAlert'),
|
||||
);
|
||||
|
||||
export default [
|
||||
{ name: 'user-delete', component: UserDeleteAlert },
|
||||
{ name: 'user-activate', component: UserActivateAlert },
|
||||
{ name: 'user-inactivate', component: UserInactivateAlert },
|
||||
];
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
import React, { useEffect } from 'react';
|
||||
import intl from 'react-intl-universal';
|
||||
|
||||
import {UsersListProvider } from './UsersProvider';
|
||||
import { UsersListProvider } from './UsersProvider';
|
||||
import withDashboardActions from 'containers/Dashboard/withDashboardActions';
|
||||
|
||||
import UsersDataTable from './UsersDataTable';
|
||||
import UsersAlerts from './UsersAlerts';
|
||||
import { compose } from 'utils';
|
||||
|
||||
/**
|
||||
@@ -15,7 +14,6 @@ function UsersListPreferences({
|
||||
// #withDashboardActions
|
||||
changePreferencesPageTitle,
|
||||
}) {
|
||||
|
||||
useEffect(() => {
|
||||
changePreferencesPageTitle(intl.get('users'));
|
||||
}, [changePreferencesPageTitle]);
|
||||
@@ -23,11 +21,8 @@ function UsersListPreferences({
|
||||
return (
|
||||
<UsersListProvider>
|
||||
<UsersDataTable />
|
||||
<UsersAlerts />
|
||||
</UsersListProvider>
|
||||
);
|
||||
}
|
||||
|
||||
export default compose(
|
||||
withDashboardActions,
|
||||
)(UsersListPreferences);
|
||||
export default compose(withDashboardActions)(UsersListPreferences);
|
||||
|
||||
Reference in New Issue
Block a user