fix(webapp): code cleanup

This commit is contained in:
Ahmed Bouhuolia
2023-09-22 15:25:56 +02:00
parent ce41845bd7
commit 92ac0dbd25
12 changed files with 32 additions and 24 deletions

View File

@@ -7,7 +7,6 @@ import { useDeleteTaxRate } from '@/hooks/query/taxRates';
import withAlertStoreConnect from '@/containers/Alert/withAlertStoreConnect';
import withAlertActions from '@/containers/Alert/withAlertActions';
import withItemsActions from '@/containers/Items/withItemsActions';
import withDrawerActions from '@/containers/Drawer/withDrawerActions';
import { compose } from '@/utils';
@@ -51,7 +50,10 @@ function TaxRateDeleteAlert({
data: { errors },
},
}) => {
// handleDeleteErrors(errors);
AppToaster.show({
message: 'Something went wrong.',
intent: Intent.DANGER,
});
},
)
.finally(() => {
@@ -86,6 +88,5 @@ function TaxRateDeleteAlert({
export default compose(
withAlertStoreConnect(),
withAlertActions,
withItemsActions,
withDrawerActions,
)(TaxRateDeleteAlert);

View File

@@ -4,8 +4,6 @@ import React from 'react';
const TaxRateDeleteAlert = React.lazy(() => import('./TaxRateDeleteAlert'));
/**
* Project alerts.
* Tax rates alerts.
*/
export default [
{ name: 'tax-rate-delete', component: TaxRateDeleteAlert },
];
export default [{ name: 'tax-rate-delete', component: TaxRateDeleteAlert }];

View File

@@ -29,7 +29,7 @@ function TaxRatesLandingProvider({ tableState, ...props }) {
};
return (
<DashboardInsider name={'cashflow-accounts'}>
<DashboardInsider name={'tax-rate-form'}>
<TaxRatesLandingContext.Provider value={provider} {...props} />
</DashboardInsider>
);

View File

@@ -9,12 +9,8 @@ const TaxRateFormDialogContent = lazy(
() => import('./TaxRateFormDialogContent'),
);
const TaxRateDialog = styled(Dialog)`
max-width: 450px;
`;
/**
* Account form dialog.
* Tax rate form dialog.
*/
function TaxRateFormDialog({
dialogName,
@@ -39,4 +35,8 @@ function TaxRateFormDialog({
);
}
const TaxRateDialog = styled(Dialog)`
max-width: 450px;
`;
export default compose(withDialogRedux())(TaxRateFormDialog);

View File

@@ -9,7 +9,7 @@ interface TaxRateFormDialogContentProps {
}
/**
* Account dialog content.
* Tax rate form dialog content.
*/
export default function TaxRateFormDialogContent({
dialogName,