From 87b883ae7706d257fa3a7fb0ab5bfad87f12e3e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Germ=C3=A1n=20Mart=C3=ADnez?= Date: Wed, 18 Dec 2019 11:19:25 +0100 Subject: [PATCH] Fix transaction description value (#377) * Fix transaction description value * Remove duplicated symbols --- .../ExpandedTx/TxDescription/index.jsx | 33 +++++++++++-------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/src/routes/safe/components/Transactions/TxsTable/ExpandedTx/TxDescription/index.jsx b/src/routes/safe/components/Transactions/TxsTable/ExpandedTx/TxDescription/index.jsx index a9f5a0c5..e8989bb4 100644 --- a/src/routes/safe/components/Transactions/TxsTable/ExpandedTx/TxDescription/index.jsx +++ b/src/routes/safe/components/Transactions/TxsTable/ExpandedTx/TxDescription/index.jsx @@ -1,6 +1,7 @@ // @flow import React, { useState } from 'react' import { withStyles } from '@material-ui/core/styles' +import { getTxAmount } from '~/routes/safe/components/Transactions/TxsTable/columns' import { type Transaction } from '~/routes/safe/store/models/transaction' import Bold from '~/components/layout/Bold' import EtherscanLink from '~/components/EtherscanLink' @@ -40,8 +41,7 @@ type Props = { } type TransferDescProps = { - value: string, - symbol: string, + amount: string, recipient: string, } @@ -52,20 +52,18 @@ type DescriptionDescProps = { } type CustomDescProps = { - value: string, + amount: string, recipient: string, data: String, classes: Object, } -const TransferDescription = ({ value = '', symbol, recipient }: TransferDescProps) => ( +const TransferDescription = ({ amount = '', recipient }: TransferDescProps) => ( Send {' '} - {value} - {' '} - {symbol} + {amount} {' '} to: @@ -99,7 +97,7 @@ const SettingsDescription = ({ removedOwner, addedOwner, newThreshold }: Descrip ) const CustomDescription = ({ - data, value = 0, recipient, classes, + data, amount = 0, recipient, classes, }: CustomDescProps) => { const [showTxData, setShowTxData] = useState(false) return ( @@ -108,9 +106,7 @@ const CustomDescription = ({ Send {' '} - {value} - {' '} - ETH + {amount} {' '} to: @@ -156,18 +152,27 @@ const CustomDescription = ({ const TxDescription = ({ tx, classes }: Props) => { const { - recipient, value, modifySettingsTx, removedOwner, addedOwner, newThreshold, cancellationTx, customTx, creationTx, data, + recipient, + modifySettingsTx, + removedOwner, + addedOwner, + newThreshold, + cancellationTx, + customTx, + creationTx, + data, } = getTxData(tx) + const amount = getTxAmount(tx) return ( {modifySettingsTx && ( )} {customTx && ( - + )} {!cancellationTx && !modifySettingsTx && !customTx && !creationTx && ( - + )} )