From d7e0fb91cdf981a453241b858225563bbaee41f9 Mon Sep 17 00:00:00 2001 From: Szymon Lesisz Date: Wed, 5 Dec 2018 14:40:28 +0100 Subject: [PATCH] add SignTx modal with SendFormRippleReducer --- src/components/modals/Container.js | 6 ++++-- src/components/modals/confirm/SignTx/index.js | 8 ++++---- src/components/modals/index.js | 7 +++++-- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/components/modals/Container.js b/src/components/modals/Container.js index 3a80f075..abe0bf33 100644 --- a/src/components/modals/Container.js +++ b/src/components/modals/Container.js @@ -19,7 +19,8 @@ type StateProps = { devices: $ElementType, connect: $ElementType, selectedAccount: $ElementType, - sendForm: $ElementType, + sendFormEthereum: $ElementType, + sendFormRipple: $ElementType, receive: $ElementType, localStorage: $ElementType, wallet: $ElementType, @@ -38,7 +39,8 @@ const mapStateToProps: MapStateToProps = (state: St devices: state.devices, connect: state.connect, selectedAccount: state.selectedAccount, - sendForm: state.sendFormEthereum, + sendFormEthereum: state.sendFormEthereum, + sendFormRipple: state.sendFormRipple, receive: state.receive, localStorage: state.localStorage, wallet: state.wallet, diff --git a/src/components/modals/confirm/SignTx/index.js b/src/components/modals/confirm/SignTx/index.js index 4668979f..1ae4297b 100644 --- a/src/components/modals/confirm/SignTx/index.js +++ b/src/components/modals/confirm/SignTx/index.js @@ -12,12 +12,11 @@ import P from 'components/Paragraph'; import Icon from 'components/Icon'; import { H3 } from 'components/Heading'; -import type { TrezorDevice } from 'flowtype'; -import type { Props as BaseProps } from '../../Container'; +import type { TrezorDevice, State } from 'flowtype'; type Props = { device: TrezorDevice; - sendForm: $ElementType; + sendForm: $ElementType | $ElementType; } const Wrapper = styled.div` @@ -51,10 +50,11 @@ const ConfirmSignTx = (props: Props) => { const { amount, address, - currency, selectedFeeLevel, } = props.sendForm; + const currency: string = typeof props.sendForm.currency === 'string' ? props.sendForm.currency : props.sendForm.networkSymbol; + return (
diff --git a/src/components/modals/index.js b/src/components/modals/index.js index 9e0a6330..e73bfdbf 100644 --- a/src/components/modals/index.js +++ b/src/components/modals/index.js @@ -88,13 +88,16 @@ const getDeviceContextModal = (props: Props) => { case 'ButtonRequest_PassphraseType': return ; - case 'ButtonRequest_SignTx': - return ; + case 'ButtonRequest_SignTx': { + const sendForm = props.selectedAccount.network && props.selectedAccount.network.type === 'ethereum' ? props.sendFormEthereum : props.sendFormRipple; + return ; + } case 'ButtonRequest_ProtectCall': return ; case 'ButtonRequest_Other': + case 'ButtonRequest_ConfirmOutput': return ; case RECEIVE.REQUEST_UNVERIFIED: