Initial commit

This commit is contained in:
Maksim Eltyshev
2019-08-31 04:07:25 +05:00
commit 36fe34e8e1
583 changed files with 91539 additions and 0 deletions
+35
View File
@@ -0,0 +1,35 @@
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
import { boardsForCurrentProjectSelector, currentUserSelector, pathSelector } from '../selectors';
import {
createBoardInCurrentProject, deleteBoard, moveBoard, updateBoard,
} from '../actions/entry';
import Boards from '../components/Boards';
const mapStateToProps = (state) => {
const { boardId } = pathSelector(state);
const { isAdmin } = currentUserSelector(state);
const boards = boardsForCurrentProjectSelector(state);
return {
items: boards,
currentId: boardId,
isEditable: isAdmin,
};
};
const mapDispatchToProps = (dispatch) => bindActionCreators(
{
onCreate: createBoardInCurrentProject,
onUpdate: updateBoard,
onMove: moveBoard,
onDelete: deleteBoard,
},
dispatch,
);
export default connect(
mapStateToProps,
mapDispatchToProps,
)(Boards);