mirror of https://github.com/trezor/trezor-wallet
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
1.0 KiB
38 lines
1.0 KiB
/* @flow */
|
|
import * as React from 'react';
|
|
import { connect } from 'react-redux';
|
|
import { bindActionCreators } from 'redux';
|
|
import * as RouterActions from 'actions/RouterActions';
|
|
|
|
import type { State, Dispatch } from 'flowtype';
|
|
import ImportView from './index';
|
|
|
|
type OwnProps = {|
|
|
children?: React.Node,
|
|
|};
|
|
export type StateProps = {|
|
|
transport: $ElementType<$ElementType<State, 'connect'>, 'transport'>,
|
|
|};
|
|
|
|
type DispatchProps = {|
|
|
selectFirstAvailableDevice: typeof RouterActions.selectFirstAvailableDevice,
|
|
|};
|
|
|
|
export type Props = {| ...OwnProps, ...StateProps, ...DispatchProps |};
|
|
|
|
const mapStateToProps = (state: State): StateProps => ({
|
|
transport: state.connect.transport,
|
|
});
|
|
|
|
const mapDispatchToProps = (dispatch: Dispatch): DispatchProps => ({
|
|
selectFirstAvailableDevice: bindActionCreators(
|
|
RouterActions.selectFirstAvailableDevice,
|
|
dispatch
|
|
),
|
|
});
|
|
|
|
export default connect<Props, OwnProps, StateProps, DispatchProps, State, Dispatch>(
|
|
mapStateToProps,
|
|
mapDispatchToProps
|
|
)(ImportView);
|