From 98413b68e6b692c9fe445f0ebe887e97658ee60d Mon Sep 17 00:00:00 2001 From: Vladimir Volek Date: Fri, 12 Apr 2019 15:25:29 +0200 Subject: [PATCH] fix flow --- .../Account/Receive/bitcoin/Container.js | 23 ++++++++----------- .../views/Account/Send/bitcoin/Container.js | 22 ++++++++---------- .../Account/Summary/bitcoin/Container.js | 23 +++++++------------ 3 files changed, 26 insertions(+), 42 deletions(-) diff --git a/src/views/Wallet/views/Account/Receive/bitcoin/Container.js b/src/views/Wallet/views/Account/Receive/bitcoin/Container.js index d4a281c8..0b782e1e 100644 --- a/src/views/Wallet/views/Account/Receive/bitcoin/Container.js +++ b/src/views/Wallet/views/Account/Receive/bitcoin/Container.js @@ -4,39 +4,34 @@ import { connect } from 'react-redux'; import { injectIntl } from 'react-intl'; import { showAddress } from 'actions/ReceiveActions'; -import type { MapStateToProps, MapDispatchToProps } from 'react-redux'; import type { State, Dispatch } from 'flowtype'; import Receive from './index'; -type OwnProps = { +type OwnProps = {| intl: any, -}; +|}; -type StateProps = { +type StateProps = {| selectedAccount: $ElementType, receive: $ElementType, modal: $ElementType, wallet: $ElementType, -}; +|}; -type DispatchProps = { +type DispatchProps = {| showAddress: typeof showAddress, -}; +|}; -export type Props = OwnProps & StateProps & DispatchProps; +export type Props = {| ...OwnProps, ...StateProps, ...DispatchProps |}; -const mapStateToProps: MapStateToProps = ( - state: State -): StateProps => ({ +const mapStateToProps = (state: State): StateProps => ({ selectedAccount: state.selectedAccount, receive: state.receive, modal: state.modal, wallet: state.wallet, }); -const mapDispatchToProps: MapDispatchToProps = ( - dispatch: Dispatch -): DispatchProps => ({ +const mapDispatchToProps = (dispatch: Dispatch): DispatchProps => ({ showAddress: bindActionCreators(showAddress, dispatch), }); diff --git a/src/views/Wallet/views/Account/Send/bitcoin/Container.js b/src/views/Wallet/views/Account/Send/bitcoin/Container.js index da85e60e..fd7a1b1d 100644 --- a/src/views/Wallet/views/Account/Send/bitcoin/Container.js +++ b/src/views/Wallet/views/Account/Send/bitcoin/Container.js @@ -6,32 +6,29 @@ import { injectIntl } from 'react-intl'; import SendFormActions from 'actions/ripple/SendFormActions'; import { openQrModal } from 'actions/ModalActions'; -import type { MapStateToProps, MapDispatchToProps } from 'react-redux'; import type { State, Dispatch } from 'flowtype'; import AccountSend from './index'; -type OwnProps = { +type OwnProps = {| intl: any, -}; +|}; -export type StateProps = { +export type StateProps = {| selectedAccount: $ElementType, sendForm: $ElementType, wallet: $ElementType, fiat: $ElementType, localStorage: $ElementType, -}; +|}; -export type DispatchProps = { +export type DispatchProps = {| sendFormActions: typeof SendFormActions, openQrModal: typeof openQrModal, -}; +|}; export type Props = OwnProps & StateProps & DispatchProps; -const mapStateToProps: MapStateToProps = ( - state: State -): StateProps => ({ +const mapStateToProps = (state: State): StateProps => ({ selectedAccount: state.selectedAccount, sendForm: state.sendFormRipple, wallet: state.wallet, @@ -39,10 +36,9 @@ const mapStateToProps: MapStateToProps = ( localStorage: state.localStorage, }); -const mapDispatchToProps: MapDispatchToProps = ( - dispatch: Dispatch -): DispatchProps => ({ +const mapDispatchToProps = (dispatch: Dispatch): DispatchProps => ({ sendFormActions: bindActionCreators(SendFormActions, dispatch), + openQrModal: bindActionCreators(openQrModal, dispatch), }); export default injectIntl( diff --git a/src/views/Wallet/views/Account/Summary/bitcoin/Container.js b/src/views/Wallet/views/Account/Summary/bitcoin/Container.js index d2502c3e..09d1840a 100644 --- a/src/views/Wallet/views/Account/Summary/bitcoin/Container.js +++ b/src/views/Wallet/views/Account/Summary/bitcoin/Container.js @@ -2,37 +2,32 @@ import { bindActionCreators } from 'redux'; import { connect } from 'react-redux'; import { injectIntl } from 'react-intl'; - -import type { MapStateToProps, MapDispatchToProps } from 'react-redux'; import * as TokenActions from 'actions/TokenActions'; - import type { State, Dispatch } from 'flowtype'; import Summary from './index'; -type OwnProps = { +type OwnProps = {| intl: any, -}; +|}; -type StateProps = { +type StateProps = {| selectedAccount: $ElementType, summary: $ElementType, wallet: $ElementType, tokens: $ElementType, fiat: $ElementType, localStorage: $ElementType, -}; +|}; -type DispatchProps = { +type DispatchProps = {| addToken: typeof TokenActions.add, loadTokens: typeof TokenActions.load, removeToken: typeof TokenActions.remove, -}; +|}; export type Props = OwnProps & StateProps & DispatchProps; -const mapStateToProps: MapStateToProps = ( - state: State -): StateProps => ({ +const mapStateToProps = (state: State): StateProps => ({ selectedAccount: state.selectedAccount, summary: state.summary, wallet: state.wallet, @@ -41,9 +36,7 @@ const mapStateToProps: MapStateToProps = ( localStorage: state.localStorage, }); -const mapDispatchToProps: MapDispatchToProps = ( - dispatch: Dispatch -): DispatchProps => ({ +const mapDispatchToProps = (dispatch: Dispatch): DispatchProps => ({ addToken: bindActionCreators(TokenActions.add, dispatch), loadTokens: bindActionCreators(TokenActions.load, dispatch), removeToken: bindActionCreators(TokenActions.remove, dispatch),