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.
trezor-wallet/src/views/Landing/views/InstallBridge/Container.js

38 lines
1.0 KiB

6 years ago
/* @flow */
import * as React from 'react';
6 years ago
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import * as RouterActions from 'actions/RouterActions';
6 years ago
import type { State, Dispatch } from 'flowtype';
import InstallBridge from './index';
5 years ago
type OwnProps = {|
children?: React.Node,
5 years ago
|};
export type StateProps = {|
transport: $ElementType<$ElementType<State, 'connect'>, 'transport'>,
|};
5 years ago
type DispatchProps = {|
selectFirstAvailableDevice: typeof RouterActions.selectFirstAvailableDevice,
5 years ago
|};
5 years ago
export type Props = {| ...StateProps, ...DispatchProps, ...OwnProps |};
6 years ago
5 years ago
const mapStateToProps = (state: State): StateProps => ({
transport: state.connect.transport,
});
6 years ago
5 years ago
const mapDispatchToProps = (dispatch: Dispatch): DispatchProps => ({
5 years ago
selectFirstAvailableDevice: bindActionCreators(
RouterActions.selectFirstAvailableDevice,
dispatch
),
});
6 years ago
5 years ago
export default connect<Props, OwnProps, StateProps, DispatchProps, State, Dispatch>(
5 years ago
mapStateToProps,
mapDispatchToProps
)(InstallBridge);