1
0
mirror of https://github.com/trezor/trezor-wallet synced 2025-03-10 05:36:04 +00:00
trezor-wallet/src/views/Wallet/components/LeftNavigation/Container.js

46 lines
1.8 KiB
JavaScript
Raw Normal View History

2018-02-20 09:30:36 +00:00
/* @flow */
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-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-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-07-30 10:52:13 +00:00
const mapStateToProps: MapStateToProps<State, OwnProps, StateProps> = (state: State, own: OwnProps): StateProps => ({
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),
gotoDeviceSettings: bindActionCreators(TrezorConnectActions.gotoDeviceSettings, dispatch),
onSelectDevice: bindActionCreators(TrezorConnectActions.onSelectDevice, dispatch),
});
2018-02-20 09:30:36 +00:00
export default withRouter(
connect(mapStateToProps, mapDispatchToProps)(LeftNavigation),
2018-08-16 14:12:32 +00:00
);