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
+9 -13
View File
@@ -1,18 +1,14 @@
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
import {
boardsForCurrentProjectSelector,
isCurrentUserManagerForCurrentProjectSelector,
pathSelector,
} from '../selectors';
import { createBoardInCurrentProject, deleteBoard, moveBoard, updateBoard } from '../actions/entry';
import selectors from '../selectors';
import entryActions from '../entry-actions';
import Boards from '../components/Boards';
const mapStateToProps = (state) => {
const { boardId } = pathSelector(state);
const boards = boardsForCurrentProjectSelector(state);
const isCurrentUserManager = isCurrentUserManagerForCurrentProjectSelector(state);
const { boardId } = selectors.selectPath(state);
const boards = selectors.selectBoardsForCurrentProject(state);
const isCurrentUserManager = selectors.selectIsCurrentUserManagerForCurrentProject(state);
return {
items: boards,
@@ -24,10 +20,10 @@ const mapStateToProps = (state) => {
const mapDispatchToProps = (dispatch) =>
bindActionCreators(
{
onCreate: createBoardInCurrentProject,
onUpdate: updateBoard,
onMove: moveBoard,
onDelete: deleteBoard,
onCreate: entryActions.createBoardInCurrentProject,
onUpdate: entryActions.updateBoard,
onMove: entryActions.moveBoard,
onDelete: entryActions.deleteBoard,
},
dispatch,
);