2017-05-27 05:30:22 +00:00
|
|
|
import { bindActionCreators } from 'redux';
|
2016-01-11 20:04:57 +00:00
|
|
|
import { connect } from 'react-redux';
|
2017-05-26 06:20:00 +00:00
|
|
|
import { createStructuredSelector } from 'reselect';
|
2017-05-27 05:30:22 +00:00
|
|
|
import Settings from '../components/pages/Settings';
|
2017-05-26 06:20:00 +00:00
|
|
|
import { getSettings, setCert, setKey, uploadCert } from '../state/settings';
|
2016-01-11 20:04:57 +00:00
|
|
|
|
2017-05-26 06:20:00 +00:00
|
|
|
const mapState = createStructuredSelector({
|
|
|
|
settings: getSettings
|
|
|
|
});
|
|
|
|
|
2017-05-27 05:30:22 +00:00
|
|
|
const mapDispatch = dispatch => ({
|
|
|
|
onCertChange(name, data) { dispatch(setCert(name, data)); },
|
|
|
|
onKeyChange(name, data) { dispatch(setKey(name, data)); },
|
|
|
|
...bindActionCreators({ uploadCert }, dispatch)
|
|
|
|
});
|
|
|
|
|
|
|
|
export default connect(mapState, mapDispatch)(Settings);
|