You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
planka_custom/client/src/containers/BoardsContainer.js

32 lines
901 B
JavaScript

import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
import selectors from '../selectors';
import entryActions from '../entry-actions';
import Boards from '../components/Boards';
const mapStateToProps = (state) => {
const { boardId } = selectors.selectPath(state);
const boards = selectors.selectBoardsForCurrentProject(state);
const isCurrentUserManager = selectors.selectIsCurrentUserManagerForCurrentProject(state);
return {
items: boards,
currentId: boardId,
canEdit: isCurrentUserManager,
};
};
const mapDispatchToProps = (dispatch) =>
bindActionCreators(
{
onCreate: entryActions.createBoardInCurrentProject,
onUpdate: entryActions.updateBoard,
onMove: entryActions.moveBoard,
onDelete: entryActions.deleteBoard,
},
dispatch,
);
export default connect(mapStateToProps, mapDispatchToProps)(Boards);