summaryrefslogtreecommitdiff
path: root/src/containers/options
diff options
context:
space:
mode:
authorKamran Ahmed <kamranahmed.se@gmail.com>2018-08-29 12:10:53 +0500
committerKamran Ahmed <kamranahmed.se@gmail.com>2018-08-29 12:10:53 +0500
commit3f41f6994743358a457d4c92625c7412de399658 (patch)
tree5900c759e4971477ee5af21761f3887a096086c3 /src/containers/options
parentComponentize options form (diff)
downloadgithunt-3f41f6994743358a457d4c92625c7412de399658.tar.gz
Save options functionality
Diffstat (limited to 'src/containers/options')
-rw-r--r--src/containers/options/index.js21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/containers/options/index.js b/src/containers/options/index.js
index d986f6e..588861d 100644
--- a/src/containers/options/index.js
+++ b/src/containers/options/index.js
@@ -1,9 +1,11 @@
import React from 'react';
+import { connect } from 'react-redux';
+import { Link } from 'react-router-dom';
import './styles.css';
import Logo from '../../components/icons/logo';
-import { Link } from 'react-router-dom';
import OptionsForm from '../../components/options-form';
+import { updateOptions } from '../../redux/preference/actions';
class OptionsContainer extends React.Component {
render() {
@@ -21,11 +23,24 @@ class OptionsContainer extends React.Component {
</div>
<div className="container shadow">
- <OptionsForm/>
+ <OptionsForm
+ updateOptions={ this.props.updateOptions }
+ options={ this.props.preference.options }
+ />
</div>
</div>
);
}
}
-export default OptionsContainer;
+const mapStateToProps = (store) => {
+ return {
+ preference: store.preference
+ };
+};
+
+const mapDispatchToProps = {
+ updateOptions
+};
+
+export default connect(mapStateToProps, mapDispatchToProps)(OptionsContainer);