diff options
| author | Kamran Ahmed <kamranahmed.se@gmail.com> | 2018-08-29 12:10:53 +0500 |
|---|---|---|
| committer | Kamran Ahmed <kamranahmed.se@gmail.com> | 2018-08-29 12:10:53 +0500 |
| commit | 3f41f6994743358a457d4c92625c7412de399658 (patch) | |
| tree | 5900c759e4971477ee5af21761f3887a096086c3 /src/containers | |
| parent | Componentize options form (diff) | |
| download | githunt-3f41f6994743358a457d4c92625c7412de399658.tar.gz | |
Save options functionality
Diffstat (limited to 'src/containers')
| -rw-r--r-- | src/containers/options/index.js | 21 |
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); |
