From 79a533940e62f65def1695fe6c0990b3165f6158 Mon Sep 17 00:00:00 2001 From: fragosti Date: Fri, 9 Nov 2018 14:20:14 -0800 Subject: feat: open metamask sliding panel if locked on click --- .../containers/connected_account_payment_method.ts | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'packages/instant/src/containers') diff --git a/packages/instant/src/containers/connected_account_payment_method.ts b/packages/instant/src/containers/connected_account_payment_method.ts index a1ebe7125..ee57d1829 100644 --- a/packages/instant/src/containers/connected_account_payment_method.ts +++ b/packages/instant/src/containers/connected_account_payment_method.ts @@ -1,10 +1,11 @@ import * as React from 'react'; import { connect } from 'react-redux'; - -import { State } from '../redux/reducer'; -import { Account, Network } from '../types'; +import { Dispatch } from 'redux'; import { PaymentMethod } from '../components/payment_method'; +import { Action, actions } from '../redux/actions'; +import { State } from '../redux/reducer'; +import { Account, Network, StandardSlidingPanelContent } from '../types'; export interface ConnectedAccountPaymentMethodProps {} @@ -13,11 +14,24 @@ interface ConnectedState { network: Network; } +interface ConnectedDispatch { + openStandardSlidingPanel: (content: StandardSlidingPanelContent) => void; +} + const mapStateToProps = (state: State, _ownProps: ConnectedAccountPaymentMethodProps): ConnectedState => ({ account: state.providerState.account, network: state.network, }); +const mapDispatchToProps = ( + dispatch: Dispatch, + ownProps: ConnectedAccountPaymentMethodProps, +): ConnectedDispatch => ({ + openStandardSlidingPanel: (content: StandardSlidingPanelContent) => + dispatch(actions.openStandardSlidingPanel(content)), +}); + export const ConnectedAccountPaymentMethod: React.ComponentClass = connect( mapStateToProps, + mapDispatchToProps, )(PaymentMethod); -- cgit v1.2.3