2018-02-20 09:30:36 +00:00
|
|
|
/* @flow */
|
2018-08-16 12:56:35 +00:00
|
|
|
import { toggleDeviceDropdown } from 'actions/WalletActions';
|
2018-02-20 09:30:36 +00:00
|
|
|
import { bindActionCreators } from 'redux';
|
|
|
|
import { connect } from 'react-redux';
|
|
|
|
import { withRouter } from 'react-router-dom';
|
|
|
|
|
2018-08-14 12:56:47 +00:00
|
|
|
import * as TrezorConnectActions from 'actions/TrezorConnectActions';
|
2018-09-20 16:24:51 +00:00
|
|
|
import * as RouterActions from 'actions/RouterActions';
|
2018-04-16 21:19:50 +00:00
|
|
|
import type { MapStateToProps, MapDispatchToProps } from 'react-redux';
|
2018-08-14 12:56:47 +00:00
|
|
|
import type { State, Dispatch } from 'flowtype';
|
2018-08-16 12:56:35 +00:00
|
|
|
|
2018-08-28 06:18:07 +00:00
|
|
|
import type { StateProps, DispatchProps } from './components/common';
|
2018-08-16 14:12:32 +00:00
|
|
|
|
2018-08-16 13:11:10 +00:00
|
|
|
import LeftNavigation from './index';
|
2018-04-16 21:19:50 +00:00
|
|
|
|
|
|
|
type OwnProps = {
|
2018-07-30 10:52:13 +00:00
|
|
|
|
2018-04-16 21:19:50 +00:00
|
|
|
}
|
|
|
|
|
2018-09-06 15:04:28 +00:00
|
|
|
const mapStateToProps: MapStateToProps<State, OwnProps, StateProps> = (state: State/* , own: OwnProps */): StateProps => ({
|
2018-07-30 10:52:13 +00:00
|
|
|
connect: state.connect,
|
|
|
|
accounts: state.accounts,
|
|
|
|
router: state.router,
|
|
|
|
deviceDropdownOpened: state.wallet.dropdownOpened,
|
|
|
|
fiat: state.fiat,
|
|
|
|
localStorage: state.localStorage,
|
|
|
|
discovery: state.discovery,
|
|
|
|
wallet: state.wallet,
|
|
|
|
devices: state.devices,
|
|
|
|
pending: state.pending,
|
|
|
|
});
|
2018-02-20 09:30:36 +00:00
|
|
|
|
2018-07-30 10:52:13 +00:00
|
|
|
const mapDispatchToProps: MapDispatchToProps<Dispatch, OwnProps, DispatchProps> = (dispatch: Dispatch): DispatchProps => ({
|
|
|
|
//onAccountSelect: bindActionCreators(AccountActions.onAccountSelect, dispatch),
|
|
|
|
toggleDeviceDropdown: bindActionCreators(toggleDeviceDropdown, dispatch),
|
|
|
|
addAccount: bindActionCreators(TrezorConnectActions.addAccount, dispatch),
|
|
|
|
acquireDevice: bindActionCreators(TrezorConnectActions.acquire, dispatch),
|
|
|
|
forgetDevice: bindActionCreators(TrezorConnectActions.forget, dispatch),
|
|
|
|
duplicateDevice: bindActionCreators(TrezorConnectActions.duplicateDevice, dispatch),
|
2018-09-20 16:24:51 +00:00
|
|
|
gotoDeviceSettings: bindActionCreators(RouterActions.gotoDeviceSettings, dispatch),
|
|
|
|
onSelectDevice: bindActionCreators(RouterActions.selectDevice, dispatch),
|
2018-07-30 10:52:13 +00:00
|
|
|
});
|
2018-02-20 09:30:36 +00:00
|
|
|
|
|
|
|
export default withRouter(
|
2018-08-16 12:56:35 +00:00
|
|
|
connect(mapStateToProps, mapDispatchToProps)(LeftNavigation),
|
2018-08-16 14:12:32 +00:00
|
|
|
);
|