feat: Optimize connect component props with redux store.

This commit is contained in:
Ahmed Bouhuolia
2020-05-10 02:14:42 +02:00
parent e590a21740
commit a0653674ff
58 changed files with 660 additions and 460 deletions

View File

@@ -23,16 +23,20 @@ import withDashboard from 'containers/Dashboard/withDashboard';
const ItemsCategoryActionsBar = ({
// #withResourceDetail
resourceName = 'item_category',
resourceFields,
// #withDialog
openDialog,
// #ownProps
onDeleteCategory,
onFilterChanged,
selectedRows,
}) => {
const onClickNewCategory = useCallback(() => {
openDialog('item-form', {});
openDialog('item-category-form', {});
}, [openDialog]);
const handleDeleteCategory = useCallback((category) => {
@@ -104,5 +108,7 @@ export default compose(
withItemsCategoriesActionsBar,
DialogConnect,
withDashboard,
withResourceDetail
withResourceDetail(({ resourceFields }) => ({
resourceFields,
}))
)(ItemsCategoryActionsBar);