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 b4123640..70fbfe14 100644 --- a/src/routes/safe/components/Transactions/TxsTable/ExpandedTx/TxDescription/index.jsx +++ b/src/routes/safe/components/Transactions/TxsTable/ExpandedTx/TxDescription/index.jsx @@ -13,7 +13,8 @@ export const TRANSACTIONS_DESC_ADD_OWNER_TEST_ID = 'tx-description-add-owner' export const TRANSACTIONS_DESC_REMOVE_OWNER_TEST_ID = 'tx-description-remove-owner' export const TRANSACTIONS_DESC_CHANGE_THRESHOLD_TEST_ID = 'tx-description-change-threshold' export const TRANSACTIONS_DESC_SEND_TEST_ID = 'tx-description-send' -export const TRANSACTIONS_DESC_CUSTOM_TEST_ID = 'tx-description-custom' +export const TRANSACTIONS_DESC_CUSTOM_VALUE_TEST_ID = 'tx-description-custom-value' +export const TRANSACTIONS_DESC_CUSTOM_DATA_TEST_ID = 'tx-description-custom-data' export const styles = () => ({ txDataContainer: { @@ -42,6 +43,8 @@ type DescriptionDescProps = { } type CustomDescProps = { + value: string, + recipient: string, data: String, classes: Obeject, } @@ -88,9 +91,24 @@ const SettingsDescription = ({ removedOwner, addedOwner, newThreshold }: Descrip ) -const CustomDescription = ({ data, classes }: CustomDescProps) => ( +const CustomDescription = ({ + data, value = 0, recipient, classes, +}: CustomDescProps) => ( <> - + + + Send + {' '} + {value} + {' '} + ETH + {' '} + to: + +
+ +
+ Data (hex encoded):
{data} @@ -109,7 +127,7 @@ const TxDescription = ({ tx, classes }: Props) => { )} {customTx && ( - + )} {!cancellationTx && !modifySettingsTx && !customTx && ( diff --git a/src/routes/safe/components/Transactions/TxsTable/ExpandedTx/TxDescription/utils.js b/src/routes/safe/components/Transactions/TxsTable/ExpandedTx/TxDescription/utils.js index affddad6..a55c986a 100644 --- a/src/routes/safe/components/Transactions/TxsTable/ExpandedTx/TxDescription/utils.js +++ b/src/routes/safe/components/Transactions/TxsTable/ExpandedTx/TxDescription/utils.js @@ -23,6 +23,11 @@ export const getTxData = (tx: Transaction): DecodedTxData => { if (tx.isTokenTransfer && tx.decodedParams) { txData.recipient = tx.decodedParams.recipient txData.value = fromWei(toBN(tx.decodedParams.value), 'ether') + } else if (tx.customTx) { + txData.recipient = tx.recipient + txData.value = fromWei(toBN(tx.value), 'ether') + txData.data = tx.data + txData.customTx = true } else if (Number(tx.value) > 0) { txData.recipient = tx.recipient txData.value = fromWei(toBN(tx.value), 'ether') @@ -49,9 +54,6 @@ export const getTxData = (tx: Transaction): DecodedTxData => { } } else if (tx.cancellationTx) { txData.cancellationTx = true - } else if (tx.customTx) { - txData.data = tx.data - txData.customTx = true } return txData