summaryrefslogtreecommitdiffhomepage
path: root/app/containers/SettingsPage.js
blob: 6152774c4bde371cd5703cf234e15cfa6165526a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import { push } from 'react-router-redux';
import Settings from '../components/Settings';
import settingsActions from '../redux/settings/actions';
import { remote, shell } from 'electron';
import { links } from '../config';

const mapStateToProps = (state) => {
  return state;
};

const mapDispatchToProps = (dispatch, _props) => {
  const { updateSettings } = bindActionCreators(settingsActions, dispatch);
  return {
    onQuit: () => remote.app.quit(),
    onClose: () => dispatch(push('/connect')),
    onViewAccount: () => dispatch(push('/settings/account')),
    onExternalLink: (type) => shell.openExternal(links[type]),
    onUpdateSettings: updateSettings
  };
};

export default connect(mapStateToProps, mapDispatchToProps)(Settings);