diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2017-07-04 04:14:03 +0200 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2017-07-04 04:14:03 +0200 |
| commit | d520c67839724e80d8b68b8fe933f1e7755a8f42 (patch) | |
| tree | 51188a9a3b7a125d1e79c899ba7058a280bcde50 /client/containers/taskForm.js | |
| parent | 2263f412817d6d2d36372e7617feb0d97fa57af8 (diff) | |
writing task form in a reduxy way
Diffstat (limited to 'client/containers/taskForm.js')
| -rw-r--r-- | client/containers/taskForm.js | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/client/containers/taskForm.js b/client/containers/taskForm.js new file mode 100644 index 0000000..ac1a214 --- /dev/null +++ b/client/containers/taskForm.js @@ -0,0 +1,24 @@ +import { h, Component } from 'preact' +import { Link } from 'react-router-dom' + +import client from '../client.js' + +import { connect } from 'react-redux' +import { setContent, setStyle, setAlpha, createTask } from '../actions' +import TaskFormView from '../components/Tasks/TaskFormView.jsx' + +const mapStateToProps = (state) => state.currentTask + +const mapDispatchToProps = { + clearContent: () => setContent(null), + clearStyle: () => setStyle(null), + setAlpha: (alpha) => setAlpha(alpha), + createTask: () => createTask(), +} + +const TaskForm = connect( + mapStateToProps, + mapDispatchToProps +)(TaskFormView) + +export default TaskForm |
