mirror of
https://github.com/plankanban/planka.git
synced 2025-07-20 21:59:43 +02:00
26 lines
685 B
JavaScript
Executable file
26 lines
685 B
JavaScript
Executable file
import { bindActionCreators } from 'redux';
|
|
import { connect } from 'react-redux';
|
|
|
|
import { currentUserSelector, projectsForCurrentUserSelector } from '../selectors';
|
|
import { openAddProjectModal } from '../actions/entry';
|
|
import Projects from '../components/Projects';
|
|
|
|
const mapStateToProps = (state) => {
|
|
const { isAdmin } = currentUserSelector(state);
|
|
const projects = projectsForCurrentUserSelector(state);
|
|
|
|
return {
|
|
items: projects,
|
|
isEditable: isAdmin,
|
|
};
|
|
};
|
|
|
|
const mapDispatchToProps = (dispatch) =>
|
|
bindActionCreators(
|
|
{
|
|
onAdd: openAddProjectModal,
|
|
},
|
|
dispatch,
|
|
);
|
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(Projects);
|