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.
45 lines
1.4 KiB
45 lines
1.4 KiB
/* @flow */
|
|
|
|
|
|
import React, { Component, PropTypes } from 'react';
|
|
import { bindActionCreators } from 'redux';
|
|
import { connect } from 'react-redux';
|
|
|
|
import { default as ReceiveActions } from 'actions/ReceiveActions';
|
|
import * as TokenActions from 'actions/TokenActions';
|
|
import type { MapStateToProps, MapDispatchToProps } from 'react-redux';
|
|
import type { State, Dispatch } from 'flowtype';
|
|
import Receive from './Receive';
|
|
|
|
import type {
|
|
StateProps as BaseStateProps,
|
|
DispatchProps as BaseDispatchProps,
|
|
} from '../SelectedAccount';
|
|
|
|
type OwnProps = { }
|
|
|
|
type StateProps = BaseStateProps & {
|
|
receive: $ElementType<State, 'receive'>,
|
|
modal: $ElementType<State, 'modal'>,
|
|
}
|
|
|
|
type DispatchProps = BaseDispatchProps & {
|
|
showAddress: typeof ReceiveActions.showAddress
|
|
};
|
|
|
|
export type Props = StateProps & BaseStateProps & DispatchProps & BaseDispatchProps;
|
|
|
|
const mapStateToProps: MapStateToProps<State, OwnProps, StateProps> = (state: State, own: OwnProps): StateProps => ({
|
|
className: 'receive',
|
|
selectedAccount: state.selectedAccount,
|
|
wallet: state.wallet,
|
|
|
|
receive: state.receive,
|
|
modal: state.modal,
|
|
});
|
|
|
|
const mapDispatchToProps: MapDispatchToProps<Dispatch, OwnProps, DispatchProps> = (dispatch: Dispatch): DispatchProps => ({
|
|
showAddress: bindActionCreators(ReceiveActions.showAddress, dispatch),
|
|
});
|
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(Receive); |