feat: refactoring alerts.

This commit is contained in:
elforjani13
2021-10-31 13:13:38 +02:00
parent 60f45f281a
commit ea466404ec
34 changed files with 264 additions and 227 deletions

View File

@@ -1,12 +1,13 @@
import React from 'react';
import BillOpenAlert from 'containers/Alerts/Bills/BillOpenAlert';
import BillDeleteAlert from 'containers/Alerts/Bills/BillDeleteAlert';
export default function BillsAlerts() {
return (
<div class="bills-alerts">
<BillDeleteAlert name={'bill-delete'} />
<BillOpenAlert name={'bill-open'} />
</div>
);
}
const BillOpenAlert = React.lazy(() =>
import('containers/Alerts/Bills/BillOpenAlert'),
);
const BillDeleteAlert = React.lazy(() =>
import('containers/Alerts/Bills/BillDeleteAlert'),
);
export default [
{ name: 'bill-delete', component: BillDeleteAlert },
{ name: 'bill-open', component: BillOpenAlert },
];

View File

@@ -6,7 +6,6 @@ import 'style/pages/Bills/List.scss';
import { BillsListProvider } from './BillsListProvider';
import BillsActionsBar from './BillsActionsBar';
import BillsAlerts from './BillsAlerts';
import BillsViewsTabs from './BillsViewsTabs';
import BillsTable from './BillsTable';
@@ -45,8 +44,6 @@ function BillsList({
<BillsViewsTabs />
<BillsTable />
</DashboardPageContent>
<BillsAlerts />
</BillsListProvider>
);
}

View File

@@ -1,10 +1,9 @@
import React from 'react';
import PaymentMadeDeleteAlert from 'containers/Alerts/PaymentMades/PaymentMadeDeleteAlert';
export default function PaymentMadesAlerts() {
return (
<div>
<PaymentMadeDeleteAlert name={'payment-made-delete'} />
</div>
);
}
const PaymentMadeDeleteAlert = React.lazy(() =>
import('containers/Alerts/PaymentMades/PaymentMadeDeleteAlert'),
);
export default [
{ name: 'payment-made-delete', component: PaymentMadeDeleteAlert },
];