blob: c9dbe385f8efb48ca078c9b991d734299fdbb3d0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
import { shell } from 'electron';
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import { push } from 'react-router-redux';
import Login from '../components/Login';
import accountActions from '../redux/account/actions';
import { links } from '../config';
const mapStateToProps = (state) => state;
const mapDispatchToProps = (dispatch, props) => {
const { loginChange, login } = bindActionCreators(accountActions, dispatch);
const { backend } = props;
return {
onSettings: () => dispatch(push('/settings')),
onLogin: (account) => login(backend, account),
onChange: (accountNumber) => loginChange({ accountNumber }),
onFirstChangeAfterFailure: () => loginChange({ status: 'none', error: null }),
onExternalLink: (type) => shell.openExternal(links[type])
};
};
export default connect(mapStateToProps, mapDispatchToProps)(Login);
|