summaryrefslogtreecommitdiffhomepage
path: root/app/containers/AccountPage.js
blob: 5e695e1d4a258e4f3f7611d4ef0439298ae9ae4f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import { push } from 'react-router-redux';
import Account from '../components/Account';
import userActions from '../actions/user';
import { shell } from 'electron';
import { links } from '../config';

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

const mapDispatchToProps = (dispatch, props) => {
  const { logout } = bindActionCreators(userActions, dispatch);
  return {
    onLogout: () => logout(props.backend),
    onClose: () => dispatch(push('/settings')),
    onViewAccount: () => dispatch(push('/settings/account')),
    onExternalLink: (type) => shell.openExternal(links[type])
  };
};

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