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/js/components/wallet/account/send/index.js

48 lines
1.5 KiB

7 years ago
/* @flow */
'use strict';
6 years ago
import * as React from 'react';
7 years ago
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
import { default as SendFormActions } from '~/js/actions/SendFormActions';
import SendForm from './SendForm';
7 years ago
import type { MapStateToProps, MapDispatchToProps } from 'react-redux';
import type { State, Dispatch } from '~/flowtype';
import type { StateProps as BaseStateProps, DispatchProps as BaseDispatchProps } from '../SelectedAccount';
type OwnProps = { }
export type StateProps = BaseStateProps & {
6 years ago
sendForm: $ElementType<State, 'sendForm'>,
fiat: $ElementType<State, 'fiat'>,
localStorage: $ElementType<State, 'localStorage'>,
6 years ago
children?: React.Node;
}
export type DispatchProps = BaseDispatchProps & {
sendFormActions: typeof SendFormActions
}
export type Props = StateProps & BaseStateProps & DispatchProps & BaseDispatchProps;
const mapStateToProps: MapStateToProps<State, OwnProps, StateProps> = (state: State, own: OwnProps): StateProps => {
7 years ago
return {
className: "send-from",
selectedAccount: state.selectedAccount,
wallet: state.wallet,
6 years ago
sendForm: state.sendForm,
6 years ago
fiat: state.fiat,
localStorage: state.localStorage
7 years ago
};
}
const mapDispatchToProps: MapDispatchToProps<Dispatch, OwnProps, DispatchProps> = (dispatch: Dispatch): DispatchProps => {
return {
7 years ago
sendFormActions: bindActionCreators(SendFormActions, dispatch),
};
}
export default connect(mapStateToProps, mapDispatchToProps)(SendForm)