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

@@ -20,6 +20,7 @@ import withAccounts from 'containers/Accounts/withAccounts';
import withAccountsTableActions from 'containers/Accounts/withAccountsTableActions';
import withViewDetail from 'containers/Views/withViewDetails';
function AccountsViewsTabs({
// #withViewDetail
viewId,
@@ -63,7 +64,6 @@ function AccountsViewsTabs({
onViewChanged && onViewChanged(customViewId);
}, [customViewId]);
// Handle click a new view tab.
const handleClickNewView = () => {
setTopbarEditView(null);
@@ -115,7 +115,6 @@ function AccountsViewsTabs({
}
const mapStateToProps = (state, ownProps) => ({
// Mapping view id from matched route params.
viewId: ownProps.match.params.custom_view_id,
});
@@ -126,7 +125,9 @@ export default compose(
withRouter,
withAccountsViewsTabs,
withDashboard,
withAccounts,
withAccounts(({ accountsViews }) => ({
accountsViews,
})),
withAccountsTableActions,
withViewDetail
)(AccountsViewsTabs);