mirror of
https://github.com/plankanban/planka.git
synced 2025-07-19 05:09:43 +02:00
Initial commit
This commit is contained in:
commit
36fe34e8e1
583 changed files with 91539 additions and 0 deletions
38
client/src/containers/ListContainer.js
Executable file
38
client/src/containers/ListContainer.js
Executable file
|
@ -0,0 +1,38 @@
|
|||
import { bindActionCreators } from 'redux';
|
||||
import { connect } from 'react-redux';
|
||||
|
||||
import { makeCardIdsByListIdSelector, makeListByIdSelector } from '../selectors';
|
||||
import { createCard, deleteList, updateList } from '../actions/entry';
|
||||
import List from '../components/List';
|
||||
|
||||
const makeMapStateToProps = () => {
|
||||
const listByIdSelector = makeListByIdSelector();
|
||||
const cardIdsByListIdSelector = makeCardIdsByListIdSelector();
|
||||
|
||||
return (state, { id, index }) => {
|
||||
const { name, isPersisted } = listByIdSelector(state, id);
|
||||
const cardIds = cardIdsByListIdSelector(state, id);
|
||||
|
||||
return {
|
||||
id,
|
||||
index,
|
||||
name,
|
||||
isPersisted,
|
||||
cardIds,
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
const mapDispatchToProps = (dispatch, { id }) => bindActionCreators(
|
||||
{
|
||||
onUpdate: (data) => updateList(id, data),
|
||||
onDelete: () => deleteList(id),
|
||||
onCardCreate: (data) => createCard(id, data),
|
||||
},
|
||||
dispatch,
|
||||
);
|
||||
|
||||
export default connect(
|
||||
makeMapStateToProps,
|
||||
mapDispatchToProps,
|
||||
)(List);
|
Loading…
Add table
Add a link
Reference in a new issue