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/Wallet/views/Import/Container.js

44 lines
1.2 KiB

6 years ago
/* @flow */
import * as React from 'react';
6 years ago
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import * as ImportAccountActions from 'actions/ImportAccountActions';
6 years ago
import type { MapStateToProps, MapDispatchToProps } from 'react-redux';
5 years ago
import type { TrezorDevice, Config, State, Dispatch } from 'flowtype';
import ImportView from './index';
6 years ago
export type StateProps = {
5 years ago
device: ?TrezorDevice,
importAccount: $ElementType<State, 'importAccount'>,
5 years ago
config: Config,
children?: React.Node,
5 years ago
};
type DispatchProps = {
importAddress: typeof ImportAccountActions.importAddress,
5 years ago
};
5 years ago
type OwnProps = {};
6 years ago
export type Props = StateProps & DispatchProps;
5 years ago
const mapStateToProps: MapStateToProps<State, OwnProps, StateProps> = (
state: State
): StateProps => ({
5 years ago
config: state.localStorage.config,
device: state.wallet.selectedDevice,
importAccount: state.importAccount,
});
6 years ago
5 years ago
const mapDispatchToProps: MapDispatchToProps<Dispatch, OwnProps, DispatchProps> = (
dispatch: Dispatch
): DispatchProps => ({
importAddress: bindActionCreators(ImportAccountActions.importAddress, dispatch),
});
6 years ago
5 years ago
export default connect(
mapStateToProps,
mapDispatchToProps
)(ImportView);