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.
56 lines
2.0 KiB
56 lines
2.0 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';
|
||
|
|
||
6 years ago
|
import { default as SendFormActions } from '../../../../actions/SendFormActions';
|
||
|
import { default as AbstractAccountActions } from '../../../../actions/AbstractAccountActions';
|
||
7 years ago
|
import SendForm from './SendForm';
|
||
7 years ago
|
|
||
7 years ago
|
import type { MapStateToProps, MapDispatchToProps } from 'react-redux';
|
||
6 years ago
|
import type { State, Dispatch } from '../../../../flowtype';
|
||
|
import type { StateProps as BaseStateProps, DispatchProps as BaseDispatchProps } from '../AbstractAccount';
|
||
7 years ago
|
|
||
|
type OwnProps = { }
|
||
|
|
||
6 years ago
|
export type StateProps = BaseStateProps & {
|
||
7 years ago
|
tokens: $ElementType<State, 'tokens'>,
|
||
|
pending: $ElementType<State, 'pending'>,
|
||
6 years ago
|
sendForm: $ElementType<State, 'sendForm'>,
|
||
7 years ago
|
fiat: $ElementType<State, 'fiat'>,
|
||
|
localStorage: $ElementType<State, 'localStorage'>,
|
||
6 years ago
|
children?: React.Node;
|
||
7 years ago
|
}
|
||
|
|
||
6 years ago
|
export type DispatchProps = BaseDispatchProps & {
|
||
7 years ago
|
sendFormActions: typeof SendFormActions
|
||
|
}
|
||
|
|
||
6 years ago
|
export type Props = StateProps & DispatchProps;
|
||
7 years ago
|
|
||
|
const mapStateToProps: MapStateToProps<State, OwnProps, StateProps> = (state: State, own: OwnProps): StateProps => {
|
||
7 years ago
|
return {
|
||
7 years ago
|
abstractAccount: state.abstractAccount,
|
||
7 years ago
|
devices: state.connect.devices,
|
||
|
accounts: state.accounts,
|
||
|
discovery: state.discovery,
|
||
|
tokens: state.tokens,
|
||
7 years ago
|
pending: state.pending,
|
||
7 years ago
|
sendForm: state.sendForm,
|
||
7 years ago
|
fiat: state.fiat,
|
||
|
localStorage: state.localStorage
|
||
7 years ago
|
};
|
||
|
}
|
||
|
|
||
7 years ago
|
const mapDispatchToProps: MapDispatchToProps<Dispatch, OwnProps, DispatchProps> = (dispatch: Dispatch): DispatchProps => {
|
||
7 years ago
|
return {
|
||
7 years ago
|
abstractAccountActions: bindActionCreators(AbstractAccountActions, dispatch),
|
||
7 years ago
|
sendFormActions: bindActionCreators(SendFormActions, dispatch),
|
||
6 years ago
|
initAccount: bindActionCreators(SendFormActions.init, dispatch),
|
||
7 years ago
|
disposeAccount: bindActionCreators(SendFormActions.dispose, dispatch),
|
||
7 years ago
|
};
|
||
|
}
|
||
|
|
||
7 years ago
|
export default connect(mapStateToProps, mapDispatchToProps)(SendForm)
|