ref: Refactoring

This commit is contained in:
Maksim Eltyshev
2022-08-04 13:31:14 +02:00
parent aa4723d7fe
commit 3f8216dca8
189 changed files with 3781 additions and 3486 deletions
+11 -22
View File
@@ -1,26 +1,15 @@
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
import {
currentProjectSelector,
currentUserSelector,
isCurrentUserManagerForCurrentProjectSelector,
notificationsForCurrentUserSelector,
} from '../selectors';
import {
deleteNotification,
logout,
openProjectSettingsModal,
openUserSettingsModal,
openUsersModal,
} from '../actions/entry';
import selectors from '../selectors';
import entryActions from '../entry-actions';
import Header from '../components/Header';
const mapStateToProps = (state) => {
const currentUser = currentUserSelector(state);
const currentProject = currentProjectSelector(state);
const notifications = notificationsForCurrentUserSelector(state);
const isCurrentUserManager = isCurrentUserManagerForCurrentProjectSelector(state);
const currentUser = selectors.selectCurrentUser(state);
const currentProject = selectors.selectCurrentProject(state);
const notifications = selectors.selectNotificationsForCurrentUser(state);
const isCurrentUserManager = selectors.selectIsCurrentUserManagerForCurrentProject(state);
return {
notifications,
@@ -34,11 +23,11 @@ const mapStateToProps = (state) => {
const mapDispatchToProps = (dispatch) =>
bindActionCreators(
{
onProjectSettingsClick: openProjectSettingsModal,
onUsersClick: openUsersModal,
onNotificationDelete: deleteNotification,
onUserSettingsClick: openUserSettingsModal,
onLogout: logout,
onProjectSettingsClick: entryActions.openProjectSettingsModal,
onUsersClick: entryActions.openUsersModal,
onNotificationDelete: entryActions.deleteNotification,
onUserSettingsClick: entryActions.openUserSettingsModal,
onLogout: entryActions.logout,
},
dispatch,
);