+ Once you delete this tax rate, you won't be able to restore the item + later. +
+ ++ Are you sure you want to delete ? If you're not sure, you can inactivate + it instead. +
+ + ); +} + +export default compose( + withAlertStoreConnect(), + withAlertActions, + withItemsActions, + withDrawerActions, +)(TaxRateDeleteAlert); diff --git a/packages/webapp/src/containers/TaxRates/alerts/index.ts b/packages/webapp/src/containers/TaxRates/alerts/index.ts new file mode 100644 index 000000000..31680d125 --- /dev/null +++ b/packages/webapp/src/containers/TaxRates/alerts/index.ts @@ -0,0 +1,11 @@ +// @ts-nocheck +import React from 'react'; + +const TaxRateDeleteAlert = React.lazy(() => import('./TaxRateDeleteAlert')); + +/** + * Project alerts. + */ +export default [ + { name: 'tax-rate-delete', component: TaxRateDeleteAlert }, +]; diff --git a/packages/webapp/src/containers/TaxRates/containers/TaxRatesLandingActionsBar.tsx b/packages/webapp/src/containers/TaxRates/containers/TaxRatesLandingActionsBar.tsx new file mode 100644 index 000000000..2f370e0ce --- /dev/null +++ b/packages/webapp/src/containers/TaxRates/containers/TaxRatesLandingActionsBar.tsx @@ -0,0 +1,61 @@ +// @ts-nocheck +import React from 'react'; +import { NavbarGroup, NavbarDivider, Button, Classes } from '@blueprintjs/core'; +import { + DashboardActionsBar, + FormattedMessage as T, + Can, + Icon, +} from '@/components'; +import { AbilitySubject, TaxRateAction } from '@/constants/abilityOption'; +import { useTaxRatesLandingContext } from './TaxRatesLandingProvider'; + +import withDialogActions from '@/containers/Dialog/withDialogActions'; + +import { DialogsName } from '@/constants/dialogs'; +import { compose } from '@/utils'; + +/** + * Tax rates actions bar. + */ +function TaxRatesActionsBar({ + // #withDialogActions + openDialog, +}) { + // Items list context. + const {} = useTaxRatesLandingContext(); + + // Handle `new item` button click. + const onClickNewItem = () => { + openDialog(DialogsName.TaxRateForm); + }; + + return ( +
+