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

43 lines
1.1 KiB

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