aboutsummaryrefslogtreecommitdiff
path: root/src/client/react/components/container/WeekSelector.js
diff options
context:
space:
mode:
authorNoah Loomans <noahloomans@gmail.com>2018-06-27 16:35:52 +0200
committerNoah Loomans <noahloomans@gmail.com>2018-06-27 16:37:25 +0200
commit949974e3edc11ffb144ead7f8a5f70d93e532e3c (patch)
tree2e2b4837efdcbab8a5d2b2cc7c8ca4627867aa6e /src/client/react/components/container/WeekSelector.js
parentba319c58150e832a79e7474bbe78738082580c77 (diff)
Move callbacks to mapDispatchToProps
Diffstat (limited to 'src/client/react/components/container/WeekSelector.js')
-rw-r--r--src/client/react/components/container/WeekSelector.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/client/react/components/container/WeekSelector.js b/src/client/react/components/container/WeekSelector.js
index 19a3947..f927117 100644
--- a/src/client/react/components/container/WeekSelector.js
+++ b/src/client/react/components/container/WeekSelector.js
@@ -81,9 +81,12 @@ class WeekSelector extends React.Component {
}
}
-const mapStateToProps = (state, { location, history }) => ({
+const mapStateToProps = (state, { location }) => ({
week: weekFromLocation(location),
+});
+
+const mapDispatchToProps = (dispatch, { location, history }) => ({
setWeek: makeSetWeek(location, history),
});
-export default withRouter(connect(mapStateToProps)(WeekSelector));
+export default withRouter(connect(mapStateToProps, mapDispatchToProps)(WeekSelector));