From 0f38ebd60a5cd85b86023e900c754bf8ff9146ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Germ=C3=A1n=20Mart=C3=ADnez?= Date: Thu, 5 Sep 2019 11:15:53 +0200 Subject: [PATCH] Create transaction from review custome tx modal window --- .../SendModal/screens/ReviewCustomTx/index.jsx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/routes/safe/components/Balances/SendModal/screens/ReviewCustomTx/index.jsx b/src/routes/safe/components/Balances/SendModal/screens/ReviewCustomTx/index.jsx index e7767ce1..80758280 100644 --- a/src/routes/safe/components/Balances/SendModal/screens/ReviewCustomTx/index.jsx +++ b/src/routes/safe/components/Balances/SendModal/screens/ReviewCustomTx/index.jsx @@ -17,6 +17,7 @@ import { copyToClipboard } from '~/utils/clipboard' import Hairline from '~/components/layout/Hairline' import SafeInfo from '~/routes/safe/components/Balances/SendModal/SafeInfo' import { setImageToPlaceholder } from '~/routes/safe/components/Balances/utils' +import { getWeb3 } from '~/logic/wallets/getWeb3' import ArrowDown from '../assets/arrow-down.svg' import { secondary } from '~/theme/variables' import { styles } from './style' @@ -30,6 +31,7 @@ type Props = { safeName: string, ethBalance: string, tx: Object, + createTransaction: Function, } const openIconStyle = { @@ -46,11 +48,18 @@ const ReviewCustomTx = ({ safeName, ethBalance, tx, + createTransaction, }: Props) => ( - {() => { + {({ openSnackbar }) => { const submitTx = async () => { + const web3 = getWeb3() + const txRecipient = tx.recipientAddress + let txData = tx.data + let txValue = tx.value ? web3.utils.toWei(tx.value, 'ether') : 0 + createTransaction(safeAddress, txRecipient, txValue, txData, openSnackbar) + onClose() } return ( @@ -104,7 +113,7 @@ const ReviewCustomTx = ({ - Ether + {'Ether'} {tx.value} {'ETH'}