blob: 5e61bdf22d10545e96d50d0fc23fe89e9ac82af7 (
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 accountActions from '../redux/account/actions';
import { shell } from 'electron';
import { links } from '../config';
const mapStateToProps = (state) => {
return state;
};
const mapDispatchToProps = (dispatch, props) => {
const { logout } = bindActionCreators(accountActions, 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);
|